PropType类型验证
PropType
在vue3中用来对props的复杂类型进行验证
从vue中引入PropType1import { PropType } from 'vue'
定义复杂类型接口1234export interface IPerson { name: string age: number}
属性类型验证12345678910props: { person: { type: Object as PropType<IPerson>, default: { name: 'Zon.', age: 100 } } },
参考来源:Vue3 + TS PropType类型验证
前端开发规范
前端开发规范
CSS相关命名规范
尽量避免使用id选择器,使用class选择器,不要使用标签选择器设置样式
使用BEM规范
标准的 BEM 写法是:.block-name__element-name--modifier-name
Block
123可以使用字母,数字,连字符进行命名任何html元素都可以成为一个block不依赖于页面上的其他block或者element。
1<header class="header"></header>
1234.header { color: #333; background: #f5f5f5;}
Element
1组成块的一部分,内部的任何元素都与块有关联,不能在块的外部使用
1234<article class="article"> <h2 class="article__title"></h2> <p class="article__content&quo ...
Hexo 常用命令
新建1hexo new "标题"
打包1hexo g
本地运行1hexo s
发布1hexo d
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick StartCreate a new post1$ hexo new "My New Post"
More info: Writing
Run server1$ hexo server
More info: Server
Generate static files1$ hexo generate
More info: Generating
Deploy to remote sites1$ hexo deploy
More info: Deployment