定义包含对象的数组并赋值
tags: {
name: string
icon: string
}[] = [
{name: '购物消费', icon: 'clothes'},
{name: '食品餐饮', icon: 'foods'},
{name: '居家生活', icon: 'houses'},
{name: '出行交通', icon: 'traffic'},
{name: '虚拟充值', icon: 'game'},
{name: '休闲娱乐', icon: 'dianying'},
定义自己的属性类型
// 定义单个tag的类型
type tag = {
id: string;
name: string;
icon: string
type TagListModel = {
// fetch,create,save均为函数
data: tag[]