摘要: 全局变量 // vue2 Vue.prototype.$http = ... // vue3 main.ts const app = createApp(App) type Filter = { priceFormat: (price: number) => string // ... } decl 阅读全文
posted @ 2022-11-08 17:55 前端之旅 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 自定义hook图片转base64 type Options = { el: string } export default function useBase64(options: Options): Promise<{ baseUrl: string }> { return new Promise( 阅读全文
posted @ 2022-11-08 17:28 前端之旅 阅读(25) 评论(0) 推荐(0) 编辑
摘要: vue3自定义指令 type Dir = { background: string } const vMove: Directive = { created() {}, beforeMount() {}, mounted(el: HTMLElement, dir: DirectiveBinding< 阅读全文
posted @ 2022-11-08 16:54 前端之旅 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 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 前端之旅 阅读(73) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示