打开一个vue项目,里面有SASS语法,其中CSS里用到/deep/,发现编译报错,如下: ERROR Failed to compile with 1 errors 10:34:52 AM error in ./src/components/floatBtn.vue?vue&type=style&index=0&id=cacbdb20&lang=scss&scoped=true& Module build failed (from ./node_modules/sa…
打开一个vue项目,里面有SASS语法,其中CSS里用到/deep/,发现编译报错,如下: ERROR Failed to compile with 1 errors 10:34:52 AM error in ./src/components/floatBtn.vue?vue&type=style&index=0&id=cacbdb20&lang=scss&scoped=true& Module build failed (from ./node_modules/sa…
默认情况下我们在Vue项目中引入了axios,是哟好难过axios进行post请求,是用application/json的方式去请求的,不过可能后端API的请求方式是form-data(application/x-www-form-urlencoded) package.json下增加qs: "qs": "^6.10.1" { "name": "newproject", "version": "0.1.0", "private": true, "scripts": { "serve": "vue-cli-servi…
Vue下,一般是使用路由router来打开其他页面,例如:this.$router.push("/home"),有时候需要在vue里打开外部的链接。 如果在html里用a标签打开外部链接,那就直接这样做: <a href='https://www.baidu.com' target='blank'></a> 如果在JS代码中打开 # 把当前页面替换成新页面(history历史记录中不会多一个,也就是说不能按返回来到上一个页面) window.location.replace('https:/…
iView的Form里,使用了baidu的edutior,vue下整合还是比较简单的,推荐下这个项目:https://github.com/haochuan9421/vue-ueditor-wrap,按照REAME.md一步步就能完成,不过遇到一个问题,就是在form-item下使用工具栏的整体高度如下,显得不协调,图示如下: 经过研究,只需要在.editor-form-item下的.ivu-form-item-content设置line-height为unset就可以了 代码如下: <style type=…
iView的table组件,使用render函数,需要展示html内容。 { title: '内容', key: "content", minWidth: 304, render: function (h, params) { return h("div", { // 可以带class的样式 class: 'quill-editor-div', // 可以带style样式 style: { // marginTop: '10px' }, domProps: { innerHTML: params.row.conte…
Vue项目中(iView/ViewDesign)使用了quill富文本编辑器项目地址:https://github.com/surmon-china/vue-quill-editor 不过有个问题,就是工具栏的内容没有垂直对齐,如图所示: <form-item label="内容"> <quill-editor ref="quillEditor" class="quill-editor" v-model="content" :options="editorOptionSimple" ><…
Vue项目中根据文档整合iView(VueDesign)的自定义主题,需要新建index.less,增加主题相关的代码。 报错如下: ERROR Failed to compile with 1 error 5:35:32 PM error in ./src/my-theme/index.less Syntax Error: // https://github.com/ant-design/ant-motion/issues/44 .bezierEasingMixin(); ^ Inline JavaScript …
在M1芯片的MacOS上做前端开发(VueJS),之前Windows的项目,里面有SASS的依赖,启动的时候提示报错,如下: Node Sass does not yet support your current environment: OS X Unsupported architecture (arm64) with Unsupported runtime (93) 找到package.json: "node-sass": "^4.14.1", 换成: "sass": "^1.45.0", 删除node_mo…
iView下的表单,例如登录表单,开发需求是填写完成表单后,按键盘上的回车需要自动调用Button的Submit方法(就是按回车和按Button的@click方法是一样的) 实现关键点: 加上 @keydown.native.enter.prevent='someMethod' <Form ref="loginForm" :model="loginForm" @keydown.native.enter.prevent="loginClicked" inline> <FormItem> <…
默认情况下,Vue项目下的页面router.push('/path/to/page')每次路由切换后,如果当前页面已经滚动到中间或者底部的时候,跳到下一个页面,默认也是scoll到相同的位置(中间或者底部),但是我们还是希望到了新页面,当前内容还是滚动到顶端。 这个应该是其他SAP(Single Page Applications )都差不多会遇到的问题。 在每个页面的生命周期mounted下面,写代码让页面滚动到顶部 mounted () { window.scrollTo(0, 0);//滚动页面到最顶端 } …