Skip to content

Instantly share code, notes, and snippets.

@dohzoh
Last active July 18, 2018 06:02
Show Gist options
  • Save dohzoh/3b1ca250c7fe4bcc667d61ce62469c65 to your computer and use it in GitHub Desktop.
Save dohzoh/3b1ca250c7fe4bcc667d61ce62469c65 to your computer and use it in GitHub Desktop.
レガシィシステムでVueとPHPの連携を考える ref: https://qiita.com/dozo/items/1116892fb6cb110265e4
<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>
<!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