Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add {{filename}} variable in templates #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mitchell-garcia
Copy link

@mitchell-garcia mitchell-garcia commented Oct 6, 2017

I use this library a lot, but have had issues with it including the directory structure into the class name. For example, if I want to make a component in a specific directory like this:

vg component Common/Typography/BigText

with this template:

<script lang="ts">
import Vue from 'vue';
import { Component } from 'vue-property-decorator';

@Component
export default class {{name_pc}} extends Vue {

}

Vue.component('{{name_pc}}', {{name_pc}});
</script>

<style module>

</style>

<template>

</template>

It will set the Vue component's name to CommonTypographyBigText, when I really just want BigText.

This PR exposes a {{filename}} variable in templates for use with Vue classes + Vue.component() function calls.

@pigeonfresh
Copy link

@mmitchellgarcia if you love vue-generator I would like to recommend @hjeti's seng-generator. It's more likely that updates will be made to this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants