错误信息如下:

Failed to compile.
./src/assets/todos.less
Module parse failed: Unexpected character '@' (1:0)
You may need an appropriate loader to handle this file type.
| @input_color: #e6e6e6;
| @input_font_weight:300;
| @checkbox_img:'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="-10 -18 100 135"><circle cx="50" cy="50" r="50" fill="none" stroke="#ededed" stroke-width="3"/></svg>';
 @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/App.vue 15:0-29
 @ ./src/App.vue
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js

解决前:
App.Vue中

<script >
import './assets/todos.less'
export default {
  name: 'app',
  data(){
    return {..}
    }
    <script >

解决:
App.vue中

<style lang="less" scoped>
  @import './assets/todos.less';
</style>

<script >
export default {
  name: 'app',
  data(){//<time>{{todo.created}}</time>
    return {..}
    }
   <script >
Logo

前往低代码交流专区

更多推荐