Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //myapp.specs.ts
- import Vue from "vue";
- import { mount } from 'avoriaz';
- import Component from "./component.vue"
- describe("My App", () => {
- it("works", () => {
- const wrapper = mount(Component);
- expect(wrapper.html()).toContain("Hello, World");
- });
- });
- //myapp.vue
- <script lang="ts" src="./component.ts"></script>
- <template src="./template.html"></template>
- <style src="./styles/styles.css"></style>
- //component.ts
- import { Foo } from "./foo"
- export default {
- data() {
- return {
- isLoading: true,
- data: new Foo()
- }
- },
- created() {
- this.populate();
- },
- methods: {
- populate() {
- new FooRepository().get().then((fooData: Foo) => {
- this.isLoading = false;
- this.data = fooData;
- });
- }
- }
- }
- //template.html
- <div v-if="!isLoading" >
- <h2>Heading</h2>
- <textarea name="myText" v-model="data.Text"></textarea>
- </div>
Add Comment
Please, Sign In to add comment