使用 Less

下载依赖:npm install less less-loader

mian.js 中添加:

import less from "less";
Vue.use(less);

使用:

<style lang="less"></style>

使用 Less 时运行报错

  • this.getOptions is not a function

  • 原因:less-loader安装的的版本过高

  • 解决:重新安装较低版本

    • npm uninstall less-loader

    • npm install less-loader@5.0.0

使用 sass

下载依赖

npm install node-sass sass-loader style-loader

使用

<style lang="scss" scoped>
<style>

使用 sass 时运行报错

报错:this.getOptions is not a function

  • 原因:sass-loader安装的的版本过高
  • 解决:重新安装较低版本
    • npm uninstall sass-loader

    • npm install sass-loader@10.1.1

在Vue中使用sass和less,并解决报错问题(this.getOptions is not a function)的更多相关文章

  1. vue 中使用 watch 出现了如下的报错

    vue 中使用 watch 出现了如下的报错 报错: Method "watch" has type "object" in the component def ...

  2. 解决vue不相关组件之间的数据传递----vuex的学习笔记,解决报错this.$store.commit is not a function

    Vue的项目中,如果项目简单, 父子组件之间的数据传递可以使用  props 或者 $emit 等方式 进行传递 但是如果是大中型项目中,很多时候都需要在不相关的平行组件之间传递数据,并且很多数据需要 ...

  3. 【整理】解决vue不相关组件之间的数据传递----vuex的学习笔记,解决报错this.$store.commit is not a function

    解决vue不相关组件之间的数据传递----vuex的学习笔记,解决报错this.$store.commit is not a function https://www.cnblogs.com/jaso ...

  4. vue项目安装scss,以及安装scss报错(this.getResolve is not a function)

    1.安装scss: npm install node-sass sass-loader vue-style-loader --save-dev //安装node-sass sass-loader vu ...

  5. php中读取中文文件夹及文件报错

    php读取时出现中文乱码 一般php输出中出现中文乱码我们可用 header ('content:text/html;charset="utf-8"'); php中读取中文文件夹及 ...

  6. javascript的倒计时功能中newData().getTime()在iOS下会报错问题解决

    javascript的倒计时功能中newData().getTime()在iOS下会报错问题解决 在做移动端时间转化为时间戳时,遇到了一个问题,安卓手机上访问时,能拿到时间戳,从而正确转换时间,而在i ...

  7. vue 解决报错1

    [Vue warn]: You are using the runtime-only build of Vue where the template compiler is not available ...

  8. IDEA中写MyBatis的xml配置文件编译报错的坑

    IDEA中写MyBatis的xml配置文件编译报错的坑 说明:用IDEA编译工具在项目中使用Mybatis框架,编写mybatis-config.xml和Mapper.xml配置文件时,编译项目出现错 ...

  9. axios interceptors 拦截 , 页面跳转, token 验证 Vue+axios实现登陆拦截,axios封装(报错,鉴权,跳转,拦截,提示)

    Vue+axios实现登陆拦截,axios封装(报错,鉴权,跳转,拦截,提示) :https://blog.csdn.net/H1069495874/article/details/80057107 ...

随机推荐

  1. django学习-17.如何提供一个规范的接口返回值

    目录结构 1.前言 2.进行实际的一个完整流程操作 2.1.第一步:编写一个用于查询用户数据的视图函数 2.2.第二步:编写对应的一个url匹配规则 2.3.第三步:启动django项目[hellow ...

  2. pytorch中修改后的模型如何加载预训练模型

    问题描述 简单来说,比如你要加载一个vgg16模型,但是你自己需要的网络结构并不是原本的vgg16网络,可能你删掉某些层,可能你改掉某些层,这时你去加载预训练模型,就会报错,错误原因就是你的模型和原本 ...

  3. linux下安装mysql8.0.x步骤

    1.下载mysql mysql官网:https://dev.mysql.com/downloads/mysql/ 将下载的mysql上传打linux 2.解压并重命名 [root@rsyncClien ...

  4. 将AOSP源码导入到Android Studio进行查看

    生成iml和ipr文件 source build/envsetup.sh lunch aosp_x86-eng # 或者直接输入lunch,然后选择对应的target make idegen deve ...

  5. 1095 Cars on Campus——PAT甲级真题

    1095 Cars on Campus Zhejiang University has 6 campuses and a lot of gates. From each gate we can col ...

  6. 微信小程序:数组拼接

    一开始用concat进行拼接,总是不行,代码如下: handleItemChange(e){ console.log(e) var itemList = e.detail.value itemList ...

  7. JAVA学生宿舍管理系统

    转: JAVA学生宿舍管理系统 需要的工具 1.SQL Server 2.Eclipse 3.JDBC连接数据库驱动 https://download.microsoft.com/download/A ...

  8. JVM之类加载器子系统

    类加载器子系统 作用 负责从文件系统或网络系统中加载class文件,class文件在开头有特殊的标记(魔术开头CA FE BA BE) ClassLoader只负责加载class文件,至于能否运行,由 ...

  9. 【pytest官方文档】解读fixtures - 1.什么是fixtures

    在深入了解fixture之前,让我们先看看什么是测试. 一.测试的构成 其实说白了,测试就是在特定的环境.特定的场景下.执行特定的行为,然后确认结果与期望的是否一致. 就拿最常见的登录来说,完成一次正 ...

  10. 微信小程序封装请求接口

    var rootDocment = 'https://123.com';//你的域名 function postData(url, data, cb) { wx.request({ url: root ...