微信公众号里的网页支付,网上很多说的是使用纯JS的方式(包括官方的例子,也是距离的纯JS的实现方式),如果我们使用的vue搭建的项目,也是类似的,下面给出我的实现方式。 package.json加入"weixin-js-sdk": "^1.6.0",如下: { "name": "test-wx", "version": "0.1.0", "private": true, "scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service …

2022-02-28 0条评论 2106点热度 0人点赞 admin 阅读全文

打开一个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…

2022-02-13 0条评论 6239点热度 0人点赞 admin 阅读全文

默认情况下我们在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…

2022-02-11 0条评论 1060点热度 0人点赞 admin 阅读全文

Vue下,一般是使用路由router来打开其他页面,例如:this.$router.push("/home"),有时候需要在vue里打开外部的链接。 如果在html里用a标签打开外部链接,那就直接这样做: <a href='https://www.baidu.com' target='blank'></a> 如果在JS代码中打开 # 把当前页面替换成新页面(history历史记录中不会多一个,也就是说不能按返回来到上一个页面) window.location.replace('https:/…

2022-02-09 0条评论 1192点热度 0人点赞 admin 阅读全文

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=…

2022-01-30 0条评论 1172点热度 0人点赞 admin 阅读全文

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…

2022-01-16 0条评论 1233点热度 0人点赞 admin 阅读全文

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" ><…

2022-01-15 0条评论 1155点热度 0人点赞 admin 阅读全文

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 …

2022-01-14 0条评论 1170点热度 0人点赞 admin 阅读全文

在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…

2021-12-12 0条评论 1282点热度 0人点赞 admin 阅读全文

iView下的表单,例如登录表单,开发需求是填写完成表单后,按键盘上的回车需要自动调用Button的Submit方法(就是按回车和按Button的@click方法是一样的) 实现关键点: 加上 @keydown.native.enter.prevent='someMethod' <Form ref="loginForm" :model="loginForm" @keydown.native.enter.prevent="loginClicked" inline> <FormItem> <…

2021-12-11 0条评论 1329点热度 0人点赞 admin 阅读全文
134567