上一页 1 2 3 4 5 6 ··· 56 下一页
摘要: interface Palette { red: number[]; green: string; blue: number[]; black?: boolean; } type Colors = 'red' | 'green' | 'blue'; type RGB = [number, numbe 阅读全文
posted @ 2023-05-11 10:36 洛晨随风 阅读(164) 评论(0) 推荐(0) 编辑
摘要: //infer 推断一个变量的类型 type arr<T> = Array<T extends () => infer U ? U : string>; //此时传入的类型T是number | string,不属于类型()=>infer U所以返回的是string type menus = arr< 阅读全文
posted @ 2023-03-28 11:25 洛晨随风 阅读(156) 评论(0) 推荐(0) 编辑
摘要: //引入 icon import { Select } from '@element-plus/icons-vue' return h(Select, { // 这里写属性 width: '1rem', height: '1.5rem' }) 阅读全文
posted @ 2023-02-27 16:51 洛晨随风 阅读(346) 评论(0) 推荐(0) 编辑
摘要: 对于TS,我用的是ts-node,npm全局安装, launch.json: { // 使用 IntelliSense 了解相关属性。 // 悬停以查看现有属性的描述。 // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 "v 阅读全文
posted @ 2023-02-10 10:40 洛晨随风 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 在vue3中,我用 reactive声明了一个属于form表单的state,我需要在提交时对其中的某些属性进行验证通过后调用emit方法提交数据到父组件,这时我对emit里面提交的数据做了如下处理: const ok = (ruleFormRef: any | undefined) => { if 阅读全文
posted @ 2023-02-07 11:12 洛晨随风 阅读(54) 评论(0) 推荐(0) 编辑
摘要: 父传子: <script> /** * @type {string} * 类型注释要这么写,相当于vue和react的props */ export let title; </script> <div> <!-- 如果你需要引用传递到组件中的所有道具,包括未使用export声明的道具,可以利用$$p 阅读全文
posted @ 2023-01-13 17:10 洛晨随风 阅读(450) 评论(0) 推荐(0) 编辑
摘要: <el-form :model="state" validate-on-rule-change="false"> <el-form-item :key="item.key" :label="item.field" :prop=//这里要使用:数据集合list.index.input组件绑定的值的名称 阅读全文
posted @ 2022-11-25 17:35 洛晨随风 阅读(2335) 评论(4) 推荐(0) 编辑
摘要: 如果没配置自定义的路由配置文件router.options.ts(配置问题详见:https://www.cnblogs.com/llcdbk/p/16882258.html),你可以按照官网的写法去定义布局、中间件等,但是如果你在项目中配置了路由文件,你会发现按照官网的写法写了以后会失效,除非是全局 阅读全文
posted @ 2022-11-15 09:56 洛晨随风 阅读(1638) 评论(0) 推荐(0) 编辑
摘要: 这里没啥特别的,要注意的是本地的js要配置再public 的目录下,举个例子如图: 其中代码解释如: useHead({ title: "红馆演唱会", script: [ { src: '/js/b.js',//不写pulic是因为路径已经有约定规则了 body: true,//true就是配置再 阅读全文
posted @ 2022-11-11 22:32 洛晨随风 阅读(1506) 评论(0) 推荐(0) 编辑
摘要: 刚安装的nuxt框架搭配vue3使用路由的时候除了按照约定的规则配置路由以外,还可以使用基于vue-router写法的路由文件去做配置,需要如图所示的位置编写文件: 其中这样的路由要注意一下: { name: "group-team-demo-name", path: "/group-:team/d 阅读全文
posted @ 2022-11-11 22:27 洛晨随风 阅读(1683) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 56 下一页