Skip to content

Instantly share code, notes, and snippets.

@Yang03
Created June 11, 2018 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yang03/158de433b6322d81945ccc66267e7310 to your computer and use it in GitHub Desktop.
Save Yang03/158de433b6322d81945ccc66267e7310 to your computer and use it in GitHub Desktop.
vue test
```
const test = Vue.component('test', {
props: ['msg'],
template:'<div><p>{{msg}}</p><slot name="action">xx</slot></div>'
})
new Vue({
el: '#app',
data: {
message: 'Hello Vue.js!'
},
components: {'test': test}
})
```
```
<script src="https://unpkg.com/vue"></script>
<div id="app">
<!-- <p>{{ message }}</p> -->
<!-- <p slot="action">
slot
</p> -->
<test :msg="message">
<div class="action" slot="action">
test
</div>
</test>
</div>
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment