Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can it using in Svelte markup? #445

Open
kevin82222 opened this issue Nov 20, 2023 · 2 comments
Open

Can it using in Svelte markup? #445

kevin82222 opened this issue Nov 20, 2023 · 2 comments

Comments

@kevin82222
Copy link

Hello,
Sorry, this's a question, not a issue😅

In the Vue project, we can auto import inside Vue template, like this:

// vite.config.js

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'

export default defineConfig({
  plugins: [
    vue(),
    AutoImport({
      vueTemplate: true, // has this option
      {
        'ziggy-js': [
          ['default', 'route'],
        ],
      },
    }),
  ],
})

And without import route from 'ziggy-js' in .vue file.

// App.vue

<template>
  <a :href="route('login')">Login</a>
</template>

But in Svelte, can the same function be implement?

Thanks!

@Shigukj
Copy link

Shigukj commented May 14, 2024

我也遇到了这个问题,在模板中无法使用自动导入的方法

@Shigukj
Copy link

Shigukj commented May 14, 2024

可能命名冲突,尝试使用其他命名并且不包含$ ,解决了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants