Created
December 4, 2016 20:48
-
-
Save anonymous/638ac57abd8c9ce3533c51350aba3cbf to your computer and use it in GitHub Desktop.
JS Bin [Custom tag for Vue.JS component container] // source https://jsbin.com/gifesom
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="[Custom tag for Vue.JS component container]"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<div id="myApp">s | |
<h1 is="my-component" title="Привет, Vue.JS!"></h1> | |
</div> | |
</body> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.3/vue.js"></script> | |
<script> | |
window.app = new Vue({ | |
el: "#myApp", | |
components: [ | |
Vue.component('my-component', { | |
render: function(creatElement) { | |
return creatElement(this.$vnode.data.tag, this.title); | |
}, | |
props: { | |
title: { | |
type: String, | |
default: 'Empty title', | |
}, | |
}, | |
}), | |
], | |
}); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment