![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vue
--新芽-
这个作者很懒,什么都没留下…
展开
-
vuex的实现
vuex的实现。实现了store,commit , dispatch原创 2023-02-10 16:37:52 · 61 阅读 · 0 评论 -
vue-router实现
主要实现router的一些基础功能,router-link、router-view。原创 2023-02-10 15:04:03 · 74 阅读 · 0 评论 -
vue组件化
组件化 提高开发效率 方便重复使用 提高维护性 便于多人协同开发 组件常用通信方式 props eventbus vuex 自定义事件 边界情况 $parent $children $root $refs provide/inject 非prop特性 $attrs $listeners props 父传子 // child props: { msg:String } // 父 <hellow msg="hello"> 自定义事件 // 子 this.$emit('add',goo原创 2021-07-08 11:57:32 · 147 阅读 · 1 评论 -
多表一起单验证
// 多表单验证 validateForms(formRefs) { let objectList = []; let results = formRefs.map(formRef => new Promise((resolve, reject) => { formRef.validate((valid, object) => {原创 2021-03-30 13:22:05 · 113 阅读 · 0 评论 -
vuex
state 存放数据的地方 相当于data 在组件中获取$store.state.xxx state: { goods : [{"buy_limit":5,"img_url":"\/\/i8.mifile.cn\/v1\/a1\/ef617fac-7489-436d-b74e-c43582f09633.jpg","num":1,"price":899,"name":"\u5c0f\u7c73\u7535\u89c64A 32\u82f1\u5bf8","goods_id":2172700021,"s原创 2020-07-08 17:34:50 · 558 阅读 · 0 评论 -
vue 小案例--图片上传
功能 实现图片上传 <template> <div class="about"> <div> <div> <img :src="'https://www.xxx.com'+item" alt="" v-for="item in pics" > </div> <label><input type="file" ref="file" @change="up()">+<原创 2020-06-28 19:29:21 · 2147 阅读 · 29 评论 -
vue 跨域代理
同源策略 当进行ajax请求时,请求的页面与服务器地址必须同源 协议一致(http) 端口号一致(如:8080) 域名一致(xxx.com) 子域名一致(www.) 跨域 绕过浏览器的同源策略请求到数据 常用的方法 jsonp: <script>标签没有同源策略 服务器响应头信息允许跨域Access-Control-Allow-Origin:* 本地服务器代理proxy 本地服务器代理proxy 服务器请求是没有同源限制的 请求本地服务器地址—>本地服务器—>原创 2020-06-28 18:39:13 · 1267 阅读 · 1 评论 -
vue 路由与路由守卫
添加路由 import Vue from 'vue' import VueRouter from 'vue-router' import Home from '../views/Home.vue' import Detail from '../views/Detail.vue' Vue.use(VueRouter) const routes = [ { path: '/', name: 'Home', component: Home }, { path: '/原创 2020-06-23 11:21:22 · 686 阅读 · 42 评论 -
vue cli 富文本编辑器
安装富文本 npm install vue-quill-editor --save 在main.js中引入 import Vue from 'vue' import VueQuillEditor from 'vue-quill-editor' import 'quill/dist/quill.core.css' import 'quill/dist/quill.snow.css' import 'quill/dist/quill.bubble.css' Vue.use(VueQuillEditor) 组件原创 2020-06-22 21:02:16 · 668 阅读 · 24 评论 -
vue简易购物车列表
功能: 删除 单选 全选 增加数量 减少数量 计算总价 计算数量 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script src="./js/vue.js"></script> </head> <body> <div id="app"> <t原创 2020-06-18 10:48:26 · 320 阅读 · 0 评论