相关疑难解决方法(0)

@apply 在 Laravel Mix 中的 Vue 组件内不起作用

我在 Laravel 中使用 Tailwind CSS 和 VueJS 组件,如下所示。

<template>

</template>

<script>

</script>

<style lang="postcss" scoped>

    .day-disabled {

        @apply text-gray-400;
    }

</style>
Run Code Online (Sandbox Code Playgroud)

然而它抱怨的是

Module parse failed: Unexpected token (685:0)
File was processed with these loaders:
 * ./node_modules/vue-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|
|
> .day-disabled {
|
|     @apply text-gray-400;
Run Code Online (Sandbox Code Playgroud)

无论如何,是否可以@apply使用 Laravel Mix 在 VueJS 组件中使用指令。这是我的webpack.mix.js

const mix = require('laravel-mix');
mix.options({ extractVueStyles: true})
   .js('resources/js/app.js', 'public/js')
   .postCss('resources/css/app.css', 'public/css', [
       require('postcss-import'), …
Run Code Online (Sandbox Code Playgroud)

laravel webpack vue.js laravel-mix tailwind-css

5
推荐指数
1
解决办法
4391
查看次数

标签 统计

laravel ×1

laravel-mix ×1

tailwind-css ×1

vue.js ×1

webpack ×1