Created
December 27, 2019 12:37
-
-
Save nicolidin/52f1c7bca34e47b707bb2ca745968404 to your computer and use it in GitHub Desktop.
trying to use static class inside template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="home"> | |
<div v-if="Thing.foo === yourData"> | |
<!--the error message: Property or method "Thing" is not defined on the instance | |
but referenced during render --> | |
<p>tata</p> | |
</div> | |
<div v-else> | |
<p>toto</p> | |
</div> | |
</div> | |
</template> | |
<script lang="ts"> | |
import { Component, Prop, Vue } from "vue-property-decorator"; | |
class Thing { | |
static foo: number = 1; | |
} | |
@Component | |
export default class Home extends Vue { | |
yourData: number = 1; | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment