BuptStEve / vuepress-plugin-demo-code

📝 Demo and code plugin for vuepress
https://buptsteve.github.io/vuepress-plugin-demo-code/
MIT License
124 stars 28 forks source link

BUG: Multiple export scripts replace each other #25

Closed henrikruscon closed 2 years ago

henrikruscon commented 4 years ago

Version Latest

Describe the bug If you have multiple two way binding data in multiple scripts, only the last one remains (they replace each other). Here is more information: https://github.com/vuepress/vuepress-community/issues/20#issuecomment-595316285

BuptStEve commented 4 years ago

For now, we can only write one export default. Maybe combine the demos into one?

<template>
  ## foo
  <input :disabled="disabled1" />

  ## bar
  <input :disabled="disabled2" />
</template>

<script>
export default {
  data() {
    return {
      disabled1: true,
      disabled2: true,
    }
  }
}
</script>

Or how about trying https://github.com/xiguaxigua/vuepress-plugin-demo-block?

henrikruscon commented 4 years ago

Thanks for the reply.

Been trying to solve it myself but seems every solution has a different downside. Hard to get it to work properly in every senario.

calebman commented 4 years ago

Try this plugin https://github.com/calebman/vuepress-plugin-demo-container?

Good support for multiple examples.