swey / fractal-vue-adapter

Vue template adapter for Fractal.
11 stars 5 forks source link

Inject styles from vue component to preview #10

Closed ITernovtsii closed 3 years ago

ITernovtsii commented 4 years ago

Currently, styles from the Vue component are ignored. This PR will inject them after the server-side rendered template.

Example.vue

<template>
    <div class="search-result">No results</div>
</template>

<script>
    export default {
        name: 'search',
    }
</script>

<style>
    .search-result {
        background-color: green;
    }
</style>

Current:

<div class="search-result">Test</div>

With PR:

<div class="search-result">Test</div>
<style>
    .search-result {
        background-color: green;
    }
</style>
ITernovtsii commented 3 years ago

I gave up fixing workflow with this adapter and built a separate tool to address all scenarios of Vue development with fractal ) https://www.npmjs.com/package/@contextualcode/fratomic-alivue - feel free to give it a try