Last active
July 18, 2018 06:02
-
-
Save dohzoh/3b1ca250c7fe4bcc667d61ce62469c65 to your computer and use it in GitHub Desktop.
レガシィシステムでVueとPHPの連携を考える ref: https://qiita.com/dozo/items/1116892fb6cb110265e4
This file contains 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 @click="changeName()"> | |
Hello, {{name}}. | |
</div> | |
</template> | |
<script> | |
export default { | |
data() { | |
return { | |
name: "world" | |
}; | |
}, | |
methods: { | |
changeName() { | |
this.name = "foobar"; | |
} | |
} | |
}; | |
</script> | |
<style lang="less" scoped> | |
div { | |
font-weight: bold; | |
color: red; | |
} | |
</style> |
This file contains 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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>VueJS Component Test</title> | |
<script src="https://unpkg.com/vue"></script> | |
</head> | |
<body> | |
<div id="wrapper"> | |
<my-component></my-component> | |
</div> | |
</body> | |
<script type="module"> | |
import App from "./src/example.js"; | |
var app = new Vue({ | |
el: '#wrapper', | |
components: { | |
myComponent: App, | |
}, | |
}); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment