会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
前端之旅
博客园
首页
新随笔
联系
订阅
管理
2023年3月14日
es6 class对象转换es5
摘要: 在线转换工具 https://babeljs.io/repl // es6 class Person { name = 'lisi' static age = null #sex = null constructor() { this.name = 'zhangsan' } set() { this
阅读全文
posted @ 2023-03-14 18:18 前端之旅
阅读(320)
评论(0)
推荐(0)
2022年11月12日
pinia修改状态的几种方式
摘要: // 1 main.current++ // 2 main.$patch({ current: 22, name: '妹妹' }) // 3 main.$patch(state => { // state.current++, (state.name = 'hahF') // }) // 4 mai
阅读全文
posted @ 2022-11-12 16:29 前端之旅
阅读(187)
评论(0)
推荐(0)
pinia初始化
摘要: pinia 安装 官网: https://pinia.vuejs.org/zh/introduction.html 安装: npm i pinia -S // main.ts import { createApp } from 'vue' import { createPinia } from 'p
阅读全文
posted @ 2022-11-12 16:17 前端之旅
阅读(623)
评论(0)
推荐(0)
2022年11月8日
全局函数和变量
摘要: 全局变量 // vue2 Vue.prototype.$http = ... // vue3 main.ts const app = createApp(App) type Filter = { priceFormat: (price: number) => string // ... } decl
阅读全文
posted @ 2022-11-08 17:55 前端之旅
阅读(34)
评论(0)
推荐(0)
自定义hooks
摘要: 自定义hook图片转base64 type Options = { el: string } export default function useBase64(options: Options): Promise<{ baseUrl: string }> { return new Promise(
阅读全文
posted @ 2022-11-08 17:28 前端之旅
阅读(36)
评论(0)
推荐(0)
自定义指令
摘要: vue3自定义指令 type Dir = { background: string } const vMove: Directive = { created() {}, beforeMount() {}, mounted(el: HTMLElement, dir: DirectiveBinding<
阅读全文
posted @ 2022-11-08 16:54 前端之旅
阅读(26)
评论(0)
推荐(0)
v-model
摘要: vue2 v-model // v-model 其实是一个语法糖 通过props 和 emit组合而成的 // 父组件props传递 <Child title.sync="父组件标题"/> <a-input v-model='keywords'/> // 子组件回传 this.$emit('upda
阅读全文
posted @ 2022-11-08 15:25 前端之旅
阅读(84)
评论(0)
推荐(0)
2022年11月2日
vite_vue3自动引入
摘要: // github地址: https://github.com/antfu/unplugin-auto-import 1. npm i -D unplugin-auto-import 2. vite.config.ts import AutoImport from 'unplugin-auto-im
阅读全文
posted @ 2022-11-02 21:14 前端之旅
阅读(97)
评论(0)
推荐(0)
tsx语法
摘要: vue3_tsx语法 // 1、插件安装 npm install @vitejs/plugin-vue-jsx -D // 2、vite.config.ts配置 import { defineConfig } from 'vite' import vue from '@vitejs/plugin-v
阅读全文
posted @ 2022-11-02 21:08 前端之旅
阅读(374)
评论(0)
推荐(0)
兄弟组件传参_bus封装
摘要: vue3 Bus兄弟组件传参 type BusClass = { emit: (name: string) => void on: (name: string, callBack: Function) => void } type ParamsKey = string | number | symb
阅读全文
posted @ 2022-11-02 20:29 前端之旅
阅读(38)
评论(0)
推荐(0)
下一页
公告