
vue
z-robot
这个作者很懒,什么都没留下…
展开
-
js 下载不弹框的解决方法
window.open && location.href 都可以实现下载的功能,但是需要跳转到新的页面。原创 2022-10-20 09:38:20 · 542 阅读 · 0 评论 -
sql+go+vue+android
PPT 内容 整理原创 2022-08-21 14:47:28 · 639 阅读 · 0 评论 -
vue3 自定义水印指令
通过添加自定义指定来实现方便的添加文字/图片 水印原创 2022-07-08 11:08:49 · 604 阅读 · 0 评论 -
后台接口说明
用户登陆 POST /login对应数据表 USERjson参数{"user":string,"password":string,}返回结果{ "expire": "2022-04-10T11:33:40+08:00", "ip": "123456", "msg": "ok", "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJJUCI6IiIsIlBBU1NXT1JEIjoiMTIzNDU2Ii原创 2022-04-10 10:56:15 · 724 阅读 · 0 评论 -
vuex四种状态一个模块三种调用方法,数据持久化
基础语法import { createApp } from 'vue'import { createStore } from 'vuex'// 创建一个新的 store 实例const store = createStore({ state () { return { count: 0 } }, mutations: { increment (state) { state.count++ // 改变状态里的变量值,只能通过这原创 2021-11-30 13:47:12 · 510 阅读 · 0 评论 -
eslint 初始化
具体解释https://www.jianshu.com/p/48a7a6e766c4我的选择? How would you like to use ESLint? // 你想怎样使用eslint - To check syntax, find problems, and enforce code style // 检查语法、发现问题并执行代码样式? What type of modules does your project use? // 您的项目使用什么类型的模块? - JavaSc原创 2021-11-23 09:45:27 · 654 阅读 · 0 评论 -
flex布局示例
eg:1<div class="container"> <div class="item"> </div></div>.container{ width: 300px; height: 300px; background-color: skyblue; display: flex; justify-content: center; // 横向居中 align-items: center; // 垂直居中}.item{转载 2021-11-22 10:25:12 · 494 阅读 · 0 评论 -
VUE 当前页获取来源路由地址
获取来源路由export default { data() { return { targetPath: "" } }, beforeRouteEnter (to, from, next) { // 此处无法通过 this 访问当前实例 next(vm=> { // 此处可通过 `vm` 访问当前组件实例 vm.targetPath = from.path; }) }}...原创 2021-11-11 11:35:59 · 2884 阅读 · 0 评论 -
antd-vue checkbox全选与反选
<div> <div style="border-bottom: 1px solid #E9E9E9;margin-bottom: 4px"> <a-checkbox :indeterminate="indeterminate" name="checkAll" :checked="checkAll" @change="onCheckAllChange"> 全选 </a-checkbox.原创 2021-11-04 10:15:31 · 1410 阅读 · 0 评论 -
Vue的路由对象
1、路由对象含义一个路由对象(route object)表示当前激活的路由的状态信息,包含了当前URL解析得到的信息,还有URL匹配到的路由记录(route records)。路由对象是不可变的,每次成功的导航都会产生一个新的对象。2、 路由对象的使用(慢慢熟悉)在组件内,即this.$route;在$route观察者回调内;router.match(location)的返回值;导航守卫的参数: router.beforeEach((to, from, next原创 2021-10-19 09:56:09 · 1963 阅读 · 0 评论 -
树菜单递归
id 自增IDpe: 上级IDtitle: 栏目名称let jn = [ { id: 1, pe: 0, title: "1" }, { id: 2, pe: 0, title: "2" }, { id: 3, pe: 1, title: "3" }, { id: 4, pe: 2, title: "4" }, { id: 5, pe: 1, title: "5" }, { id: 6, pe: 0, title: "6" }, ];this.treeDa.原创 2021-08-09 13:27:30 · 90 阅读 · 0 评论 -
vue3中 watch、watchEffect区别
1、watch是惰性执行,也就是只有监听的值发生变化的时候才会执行,但是watchEffect不同,每次代码加载watchEffect都会执行(忽略watch第三个参数的配置,如果修改配置项也可以实现立即执行)2、watch需要传递监听的对象,watchEffect不需要3、watch只能监听响应式数据:ref定义的属性和reactive定义的对象,如果直接监听reactive定义对象中的属性是不允许的,除非使用函数转换一下4、watchEffect如果监听reactive定义的对象是不起作用的,只.转载 2021-07-22 08:53:09 · 1863 阅读 · 0 评论 -
cordova开发环境搭建
最近我在尝试了解跨平台技术的发展,首先则是想到了cordova。本文简单记录下cordova环境搭建的过程。安装cordova首先是要npm全局安装cordovanpm install -g cordova创建应用安装的cordova类似于create-react-app这种脚手架,可以通过命令行直接创建应用cordova create myapp添加平台支持cordova可以支持ios, android, web三端。cordova platform add ioscordova p转载 2021-05-13 10:44:21 · 969 阅读 · 0 评论 -
WEBSTORM 自动保存匹配 prettier
原创 2021-04-21 11:43:49 · 476 阅读 · 0 评论 -
使用nvm 管理 nodejs npm 版本
macOS系统和windows系统安装nodejs,部分linux可以参考macOS的安装方式。LUNIX 安装nvmnvm是nodejs的版本管理工具,可以快速切换更新nodejs版本windows系统使用nvm-windows。curl下载:curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bashwget下载:wget -qO- https://raw.githubusercontent原创 2021-04-21 09:19:00 · 1344 阅读 · 0 评论 -
Lodash 总结
数组数组创建随机创建数组 range_.range([start=0], end, [step=1]) let arr = _.range(24) console.log(arr) // [0, 1, 2, 3, ... , 23]创建相同元素数组 fill_.fill(array, value, [start=0], [end=array.length]) let arr = _.fill(Array(5), 100) conso原创 2021-04-09 09:41:49 · 530 阅读 · 1 评论 -
underscore 小结
遍历each // 数组拆分 _.each([1, 2, 3], function (num,key) { console.log(num) // 1 2 3 console.log("key:"+key) // 0 1 2 }); // 对象拆分 注意,KEY VALUE 是倒的 let obj = {one: 1, two: 2, three: 3} _.each(obj, (c,key)=>{ console.log原创 2021-04-08 11:31:08 · 229 阅读 · 0 评论 -
巧用 ES6,轻松优化 Vue 代码
简写方法定义// Without shorthand(没有简写){ methods: { getValue: function() { // ... } }, computed: { halfValue: function() { // ... } }, created: function() { // ... }}// With ES6 shorthand(使用ES6简写){ methods: { getValue() { // ... }原创 2021-01-30 17:22:10 · 229 阅读 · 0 评论 -
nuxt.js 部署 vue应用到服务端过程
环境宝塔nginx+mysql+pm2建立站点通过宝塔面板直接新建立网站上传文件.nuxtstaticnuxt.config.jspackage.json启动程序进入上传文件的目录,运行npm install 安装package里的依赖在文件目录中,运行npm start 检测是否可以正常启动通过 PM2 启动不通过菜单 添加,在终端中直接执行,注意应在上传文件目录中执行pm2 start npm --name "my-nuxt" -- r原创 2020-12-18 15:35:07 · 307 阅读 · 1 评论 -
对JSON对象按指定字段进行分组
对JSON对象按指定字段进行分组 groupBy(list, keyGetter) { const map = new Map(); list.forEach((item) => { const key = keyGetter(item); const collection = map.get(key); if (!collection) { map.set(key, [item]); } else {原创 2020-12-04 09:35:34 · 1513 阅读 · 0 评论 -
vue安装与创建项目
全局安装vueclinpm i -g @vue/cli创建项目vue create hellWorld// 选择默认引入eslint直接复制即可vue add eslintvue add eslint --config airbnb --lintOn save // 跳过提示安装路由npm install save vue-router建制router.jsimport Vue from "vue"import Router from "vue-rou.原创 2020-08-01 10:44:10 · 213 阅读 · 0 评论