Clicking into one component and importing a new th

2019-03-05 10:48发布

问题:

I have a button component thus...

import "./button.scss";

const button = '<button class="btn">Button</button>';

export default button;

When it gets clicked I want to import a new theme ie this line ... "./new-theme.scss"; ... into this component

import "./article.scss";

const article = `<article class="article">
    <h1>Sharing variables between JS and Sass using webpack sass-loader</h1>
    <p>This is the GitHub repo and project files for the article on how to share variables between JS and Sass using webpack and sass-loader.</p>
    <p><a href="https://medium.com/@paul.motionimaging/sharing-variables-between-js-and-sass-using-webpack-sass-loader-713f51fa7fa0
">Read the full article</a>
  </article>`;

export default article;

...is it possible to do this?