vue3 + element-plus.自研用.
-
ref,reactive, toRef, toRefs区别?
- ref可用任何类型的数据创建响应式,reactive只用于创建引用类型数据的响应式
- ref创建响应式不影响原始值,reactive会影响原始数据
- ref返回一个对象,非模板中使用.value访问,模板中不用,内部做了自动展开
- ref,reactive会触发试图更新,toRef、toRefs只触发数据更新
- toRef 用于创建对象指定的属性响应式,换句话说就是只能控制一个对象中的一个属性,toRefs 用于创建对象响应式
- 只有toRefs 返回的对象能够解构
-
如何在setup函数内通过ref获取表单dom元素
// 注意loginForm同步
<el-form ref="loginForm" :model="form" :rules="formRules"></el-form>
setup() {
const loginForm = ref()
const formDom = unref(loginForm)
formDom.validate(() => {})
return {
loginForm
}
}
- 提交格式
<gitmoji> <commit type>: <description>
// eg
:sparkles: feat: add theme change
- 在线配置
- tags
- with ts
- axios封装
- mock
- i18n
- login background with threejs
- vite
- 使用依赖
commitlint-config-gitmoji
提交代码需要将gitmoji.json添加至node_modules/commitlint-plugin-gitmoji/lib
folder
# if you meet the below error. It means that you failed to fetch the gitmojis.json file.
Failed to fetch gitmoji JSON, please refer to https://github.com/arvinxx/gitmoji-commit-workflow/tree/master/packages/plugin#fetch-error for help.
参考框架: