Skip to content

Instantly share code, notes, and snippets.

@dbilovd
Created February 28, 2019 21:30
Show Gist options
  • Save dbilovd/6b23c4ce461cc062ceb9f8f3929e5bfe to your computer and use it in GitHub Desktop.
Save dbilovd/6b23c4ce461cc062ceb9f8f3929e5bfe to your computer and use it in GitHub Desktop.
<template>
<div>
<Button>{{ text }}</Button>
<div>
</template>
<script>
export default {
props: {
text: {
type: String,
default: ""
}
}
}
</script>
<template>
<div>
<h1>Welcome</h1>
<ExampleButton :text="buttonText" />
<div>
</template>
<script>
export default {
data () {
return {
buttonText: "Say Hello"
}
}
}
</script>
<template>
<div>
<Button v-bind="$attrs">{{ text }}</Button>
<div>
</template>
<script>
export default {
inheritedAttrs: false,
props: {
text: {
type: String,
default: ""
}
}
}
</script>
<template>
<div>
<h1>Welcome</h1>
<ExampleButton name="example-button" :text="buttonText" />
<div>
</template>
<script>
import ExampleButton from './ExampleButton';
export default {
components: {
ExampleButton
},
data () {
return {
buttonText: "Say Hello"
}
}
}
</script>
<template>
<div>
<Button>{{ text }}</Button>
<div>
</template>
<script>
export default {
props: {
text: {
type: String,
default: ""
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment