Skip to content
Discussion options

You must be logged in to vote

First, that's not a good practice and second that doesn't work. Webpack can't see those script tags. Here's a basic example how one can achieve reactivity:

  1. Create a component in src/vue/components/render/demo.vue:
<template>
  <div>
    {{ currentVariantId }}
  </div>
</template>

<script>
export default {
  name: 'demoComponent',
  props: {
    currentVariantId: {
      type: String,
      required: true
    }
  }
}
</script>
  1. Add the component to your liquid file and pass the data to the component:
<demo-component current-variant-id="{{ some-liquid-data }}"></demo-component>

Here's another example but based on renderless-components:

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@brenomzy
Comment options

@Elkaroui
Comment options

Answer selected by Elkaroui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants