vite-plugin-vue-layouts | Vue layout plugin for Vite | Frontend Framework library
kandi X-RAY | vite-plugin-vue-layouts Summary
kandi X-RAY | vite-plugin-vue-layouts Summary
This works best along with the vite-plugin-pages. Layouts are stored in the /src/layouts folder by default and are standard Vue components with a in the template. Pages without a layout specified use default.vue for their layout. You can use route blocks to allow each page to determine its layout. The block below in a page will look for /src/layouts/users.vue for its layout. See the Vitesse starter template for a working example.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vite-plugin-vue-layouts
vite-plugin-vue-layouts Key Features
vite-plugin-vue-layouts Examples and Code Snippets
Community Discussions
Trending Discussions on vite-plugin-vue-layouts
QUESTION
I've got a Vue 3 project running Vitesse (a Vite starter). I've added a custom ProductData
type to my src/types.ts
, but when I try to use it in one of my pages the page fails to load and I get a few console errors all saying SyntaxError: import not found: ProductData
. The path for the import is definitely correct, the type is exported, and I've tried importing from ts files in different locations as well but see the same thing.
Interestingly I do not have any issues importing these types from my store
files, just from *.vue files. Any ideas? This post mentions adding some things to shims.d.ts
and tsconfig.json
, but they didn't make a difference.
EDIT: Forgot to include my tsconfig.json
. This is with include
from @flydev:
ANSWER
Answered 2021-Sep-04 at 20:05I came across this comment in an issue in vitejs/vite:
There is a know issue in Vue with type imports, it should work if you use the import type form:
import type { User } from '~/types'
Changing my import from import { ProductData } from '~/types'
to import type { ProductData } from '~/types'
seems to fix the problem. Once I fixed my import, I saw the same thing happening with a third-party type, and updating the import fixed that one as well.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install vite-plugin-vue-layouts
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page