From ae2b88c2f032e6a8bbfe04a80975515ce65acdfa Mon Sep 17 00:00:00 2001 From: theia Date: Thu, 2 Feb 2023 11:13:32 -0500 Subject: No wrapping components with graffiti-objects --- plugins/vue/demo/components/chat.js | 61 ++++++++++++++++++------------------- plugins/vue/demo/components/name.js | 13 +++++--- plugins/vue/demo/index.html | 12 ++------ 3 files changed, 40 insertions(+), 46 deletions(-) diff --git a/plugins/vue/demo/components/chat.js b/plugins/vue/demo/components/chat.js index 800ac45..b8537db 100644 --- a/plugins/vue/demo/components/chat.js +++ b/plugins/vue/demo/components/chat.js @@ -4,25 +4,22 @@ export default { components: { Name }, - props: ['tags', 'objects'], + props: ['tags'], data: ()=> ({ message: '' }), - computed: { - messages() { - return this.objects - .filter(o=> - 'message' in o && - 'timestamp' in o && - typeof o.message == 'string' && - typeof o.timestamp == 'number') - .sortBy('timestamp') - } - }, - methods: { + messageObjects(objects) { + return objects.filter(o=> + 'message' in o && + 'timestamp' in o && + typeof o.message == 'string' && + typeof o.timestamp == 'number') + .sortBy('timestamp') + }, + sendMessage() { if (!this.message) return this.$graffitiUpdate({ @@ -35,25 +32,25 @@ export default { }, template: ` - + + +
diff --git a/plugins/vue/demo/components/name.js b/plugins/vue/demo/components/name.js index ec1de62..7189349 100644 --- a/plugins/vue/demo/components/name.js +++ b/plugins/vue/demo/components/name.js @@ -1,10 +1,10 @@ export const Name = { - props: ["of", "objects"], + props: ["of"], - computed: { - name() { - const nameObjects = this.objects + methods: { + name(objects) { + const nameObjects = objects .filter(o=> 'name' in o && 'of' in o && @@ -20,7 +20,10 @@ export const Name = { } }, - template: '{{name}}' + template: ` + + {{ name(objects) }} + ` } export const SetMyName = { diff --git a/plugins/vue/demo/index.html b/plugins/vue/demo/index.html index 9b51f6d..6f0fb71 100644 --- a/plugins/vue/demo/index.html +++ b/plugins/vue/demo/index.html @@ -44,10 +44,7 @@

- My name is: - - - + My name is:

@@ -58,9 +55,7 @@ Chatting - - - + @@ -70,9 +65,8 @@ - - + -- cgit v1.2.3-70-g09d2