type RecordListModel = { data: }
data: [] as RecordItem[]
// custom.d.ts interface Window { tagList: Tag[] } // 目的是防止自己手贱
tag 里面除了 id 的所有东西
window.updateTag = (id: string, object: Exclude<Tag, 'id'>){ }
类型一样进行简写
interface Window { tagList: Tag[], createTag: (name: string) => void, removeTag: (id:string) => boolean, // updateTag: (id:string, name: string) => 'success' | 'not found' | 'duplicated' updateTag: TagListModel['update'] }
import store2 from '@/store/index2.ts' Vue.prototype.$store2 = store2 // 就可以在任何一个实例中用this.$store2来访问
https://cn.vuejs.org/v2/guide/typescript.html#%E5%A2%9E%E5%BC%BA%E7%B1%BB%E5%9E%8B%E4%BB%A5%E9%85%8D%E5%90%88%E6%8F%92%E4%BB%B6%E4%BD%BF%E7%94%A8