Skip to content
Discussion options

You must be logged in to vote

我有试一下把utils整个copy过来,然后好像把<script>中的import改了就没这个报错了。

<script>
-  import { showToast } from 'astro-pure/utils'
+  import { showToast } from '@/utils'

  // Copy link
  const copyLink = document.getElementById('copy-link')
  copyLink?.addEventListener('click', () => {
    navigator.clipboard.writeText(window.location.href)
    // Show toast
    showToast({ message: 'Link copied!' })
  })

......

</script>

对这方面确实不太懂😂

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by cworld1
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants