xiaosi
1 year ago
21 changed files with 388 additions and 379 deletions
@ -0,0 +1,7 @@ |
|||||
|
[*.{js,json,jsx,ts,tsx,vue,cjs}] |
||||
|
indent_style = space |
||||
|
indent_size = 4 |
||||
|
end_of_line = lf |
||||
|
trim_trailing_whitespace = true |
||||
|
insert_final_newline = true |
||||
|
max_line_length = 180 |
Before Width: | Height: | Size: 276 B After Width: | Height: | Size: 287 B |
@ -1,12 +1,13 @@ |
|||||
import { ref, computed } from 'vue' |
|
||||
import { defineStore } from 'pinia' |
|
||||
|
import {ref, computed} from 'vue' |
||||
|
import {defineStore} from 'pinia' |
||||
|
|
||||
export const useCounterStore = defineStore('counter', () => { |
export const useCounterStore = defineStore('counter', () => { |
||||
const count = ref(0) |
const count = ref(0) |
||||
const doubleCount = computed(() => count.value * 2) |
const doubleCount = computed(() => count.value * 2) |
||||
|
|
||||
function increment() { |
function increment() { |
||||
count.value++ |
count.value++ |
||||
} |
} |
||||
|
|
||||
return { count, doubleCount, increment } |
|
||||
|
return {count, doubleCount, increment} |
||||
}) |
}) |
||||
|
Loading…
Reference in new issue