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

Usage in Vue.js #8

Closed
ghost opened this issue Oct 7, 2018 · 5 comments
Closed

Usage in Vue.js #8

ghost opened this issue Oct 7, 2018 · 5 comments

Comments

@ghost
Copy link

ghost commented Oct 7, 2018

Hi, there is no problem. I just want people to know how to use Sal.js in Vue.js.

After installing Sal with npm, call Sal by using
import sal from "sal.js";
in <script> tag, then use

 mounted() {
    sal();
  }

method. After that you can use Sal attributes but do not forget to import Sal.css!

@mciastek
Copy link
Owner

mciastek commented Dec 6, 2018

Closing, due to inactivity. Reopen, when needed.

@mciastek mciastek closed this as completed Dec 6, 2018
@EmmyMay
Copy link

EmmyMay commented Jun 11, 2020

Where would you import the Css?

@thvozdovic
Copy link

Not animating in using Vue 3, opacity stays at 0

@langfeld
Copy link

Not animating in using Vue 3, opacity stays at 0

You have to execute the command in the respective component.

This works:

<script setup lang="ts">
import sal from 'sal.js'
import { onMounted } from 'vue';

onMounted(() => {
  sal();
});
</script>

<style>
@import '/node_modules/sal.js/dist/sal.css';
</style>

@bhupendpatil
Copy link

bhupendpatil commented Aug 28, 2022

you can globally set sal.js by adding following code in main.ts/main.js

import "sal.js/dist/sal.css";
import sal from "sal.js";
window.sal = sal;

const app = createApp(App);

app.mount("#app");

app.mount(sal());

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

5 participants