1234567891011121314151617181920212223242526 |
- <template>
- <div>
- <button @click="$emit('countChange', counte++)">emit value</button>
- <div>from parent: {{passToChild}} </div>
- <div>from parent to computed: {{computedFromProps}} </div>
- </div>
- </template>
- <script>
- export default {
- name: "child",
- props: {
- passToChild: String
- },
- data() {
- return {
- counte: 0
- };
- },
- computed: {
- computedFromProps: function() {
- return "computed: " + this.passToChild;
- }
- }
- };
- </script>
|