<template>
  <div>
    <span>{{ test }}</span>
    <el-button @click="change">
      修改
    </el-button>
  </div>
</template>

<script lang="ts">
import { computed, defineComponent } from 'vue-demi'
import { useTestStore } from '../store/test'

export default defineComponent({
  name: 'TestIndex',
  setup () {
    const testStore = useTestStore()
    const test = computed(() => testStore.test)
    function change () {
      testStore.changeTest('this is a change state')
    }
    return {
      test,
      change
    }
  }
})
</script>
