url() pointing to asset file within stylus
-
<style lang="stylus" scoped> main background: url(~assets/background.jpg) no-repeat center center fixed </style>
This gives me the following error:
Module build failed: Error: /home/alex/github/node-admin-client/src/pages/index.vue:14:20 10| </template> 12| <style lang="stylus" scoped> 13| main { 14| background: url(~assets/background.jpg) no-repeat center center fixed; --------------------------^ TypeError: expected unit, but got ident:assets
What can I do to fix this, using the same as CSS works.
-
Can anybody help? I made an example here https://codepen.io/anon/pen/GxvYEJ
-
@alinex
With simple quote for the url, I think it will be ok:<style lang="stylus" scoped> main background: url('~assets/background.jpg') no-repeat center center fixed </style>
-
Thanks, that’s it - so simple.