You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -144,6 +147,32 @@ You should import styles in the `<script>` tag in each component.
144
147
145
148
You can also put style in the `<style>` tag in each component, scoped or not, the style injection works the same way using scss files or `<style>` tag.
146
149
150
+
## Assets
151
+
152
+
### Imported assets
153
+
154
+
Assets (images, fonts...) used directly in views (Like logo... etc) should be placed in src/assets (`@Asset`) and imported like a JavaScript module and used like a variable. Example:
155
+
156
+
```js
157
+
importlogofrom"@/images/logo.png";
158
+
```
159
+
160
+
You can also import it in scss using webpack resolved path or relative path as usual. Example:
Assets used directyle in `static/index.html` like favicon for example should be placed in `static/assets` and will be copied on build in the `dist/assets` directory.
175
+
147
176
## Single file components
148
177
149
178
This starter uses [Single File Components](https://vuejs.org/v2/guide/single-file-components.html) structure, which is more suitable for large project but doesn't make it harder for small apps.
@@ -166,6 +195,8 @@ Webpack allows to put some aliases in the webpack config, so you can have shorte
166
195
-`@ComponentStyle` pointing to `src/scss/components`
167
196
-`@View` pointing to `src/views`
168
197
-`@ViewStyle` pointing to `src/scss/views`
198
+
-`@Asset` pointing to `src/assets`
199
+
-`@` pointing to `src`
169
200
170
201
An example usage of these aliases is to get the API helper from a view/component:
0 commit comments