index.uts 351 字节
Newer Older
Y
init  
yurj26 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
export type State = {
    colorIndex: number,
    currentColor: string
}

const colorList: string[] = ['#FF0000', '#00FF00', '#0000FF']

export const state = reactive({
    colorIndex: 0,
    currentColor: colorList[0]
} as State)

export const setColorIndex = (index: number) => {
  state.colorIndex = index
  state.currentColor = colorList[index]
}