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

how use linq width vue #64

Open
fan92rus opened this issue Sep 1, 2019 · 2 comments
Open

how use linq width vue #64

fan92rus opened this issue Sep 1, 2019 · 2 comments

Comments

@fan92rus
Copy link

fan92rus commented Sep 1, 2019

i can't understan how connect your linq to vue project.

@mihaifm
Copy link
Owner

mihaifm commented Sep 2, 2019

Hi, I don't have any experience with Vue, you have a better chance of getting help if you ask this on Stackoverflow.

Make sure to better describe your use case and provide code samples.

@ryanelian
Copy link

Hi, try using this tool: https://github.com/ryanelian/instapack

ipack new vue

You should now be able to import LINQ from the Vue code (for example in MyLINQ.vue)

<template>
    <div>
        <p>{{x}}</p>
    </div>
</template>

<script lang="ts">
import Vue from 'vue';
import Component from 'vue-class-component';
import Enumerable from 'linq';

@Component({})
export default class MyLINQ extends Vue {
    x: number = Enumerable.from([1, 2, 3]).sum();
}
</script>

As usual, then you'd want to register the component (in vue-project.ts which is imported from index.ts entry point). You know, the usual Vue stuff:

import Vue from 'vue';
import MyLINQ from './components/MyLINQ.vue';

Vue.component('my-linq', MyLINQ);
new Vue().$mount('#app');

When done, simply use the component in your app. Also the usual Vue stuff:

<div id="app">
  <my-linq></my-linq>
</div>

then build: ipack (production) or ipack -dw (dev+watch mode) or ipack -h (hot reload mode)

then reference the built script on your html:

<link rel="stylesheet" href="wwwroot/css/ipack.css" />

<script src="wwwroot/js/ipack.dll.js"></script>
<script src="wwwroot/js/ipack.js"></script>

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

No branches or pull requests

3 participants