Code:
<!DOCTYPE html>
<html>
<head>
<title>My first Vue app</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
</head>
<body>
<div id="app">
<x :type="type"></x>
</div>
<script>
Vue.component('x', {
props : ['type'],
template : '<input>'
});
const x = new Vue({
el : '#app',
data : {
type : `password`,
},
})
</script>
</body>
</html>
Why wont :type="type" work here in this scenario and create and element like so : <input type="password">?