javascript - How to apply Vue.js scoped styles to components loaded via view-router? -


how can apply vue.js scoped styles components loaded via <view-router>.

here code:

<template>   <div id="admin">     <router-view></router-view>   </div> </template>  <style lang="scss" scoped> #admin {   .actions {     display: none;     span {       cursor: pointer;     }   } } </style> 

when visit /posts component named posts loaded, inside component have

<div class="actions">   content </div> 

the problem style defined in #admin not applied .action element. when not scoped, works fine. problem come when #admin component styling scoped.

is there way while keeping .actions style inside admin component scoped style tag?

you can put styles in separate file , reference components need it:

<style src="path/to/your/styles" lang="scss" scoped></style>


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -