我在 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)