salix-front/test/jest/__tests__/demo/MyButton.ts

21 lines
450 B
TypeScript
Raw Normal View History

2022-03-11 10:25:30 +00:00
import { defineComponent, ref } from 'vue';
export default defineComponent({
name: 'MyButton',
props: {
incrementStep: {
type: Number,
default: 1,
},
2022-03-11 10:25:30 +00:00
},
setup(props) {
const counter = ref(0);
const input = ref('rocket muffin');
function increment() {
counter.value += props.incrementStep;
}
2022-03-11 10:25:30 +00:00
return { counter, input, increment };
},
2022-03-11 10:25:30 +00:00
});