vue-codemirror icon indicating copy to clipboard operation
vue-codemirror copied to clipboard

how to use api openSearchPanel in vue3-jsx ?

Open sy19971224 opened this issue 1 year ago • 1 comments

Describe the bug

export default defineComponent({
  name: 'log',
  title: 'Web IDE example',
  url: import.meta.url,
  components: {
    Codemirror
  },
  props,
  setup(props) {
    const editorRef = ref()

    const code = shallowRef(props.code)
    onMounted(() => {
    **_// TODO:i want to use api (openSearchPanel) here,how ???_**
      watch(
        () => props.code,
        (_code) => {
          code.value = _code
        }
      )
    })

    return {
      ...
    }
  },

  render() {
    const {
    ...
    } = this

    return (
      <div class={styles['editor']}>
        <div class={styles['main']}>
          <NButton>openSearch</NButton>
          <Codemirror
            v-model={code}
            extensions={[oneDark, search({ top: true })]}
            disabled={config.disabled}
          ></Codemirror>
        </div>
      </div>
    )
  }
})

Reproduction

no

System Info

node 16.0.0
codemirror ^6

Used Package Manager

pnpm

Validations

  • [X] Read the the documentation in detail.
  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [X] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
  • [X] The provided reproduction is a minimal reproducible example of the bug.

sy19971224 avatar Mar 01 '23 10:03 sy19971224

please help me ,thanks!!!!!!!!!!1🧎🏻

sy19971224 avatar Mar 01 '23 10:03 sy19971224