mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-21 21:20:36 +03:00
add vue example
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
"@angular/core": ">=10.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/build-angular": "0.1002.4",
|
||||
"@angular-devkit/build-angular": "~0.1002.4",
|
||||
"@angular/animations": "^10.0.0",
|
||||
"@angular/cli": "^10.0.0",
|
||||
"@angular/common": "^10.0.0",
|
||||
|
||||
-6726
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,22 @@
|
||||
{
|
||||
"name": "vue-project",
|
||||
"version": "0.0.0",
|
||||
"name": "overlayscrollbars-vue",
|
||||
"private": true,
|
||||
"version": "0.4.0",
|
||||
"files": [
|
||||
"src",
|
||||
"dist",
|
||||
"README.md"
|
||||
],
|
||||
"main": "./dist/overlayscrollbars-vue.umd.js",
|
||||
"module": "./dist/overlayscrollbars-vue.es.js",
|
||||
"types": "./dist/overlayscrollbars-vue.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"require": "./dist/overlayscrollbars-vue.umd.js",
|
||||
"import": "./dist/overlayscrollbars-vue.es.js",
|
||||
"types": "./dist/overlayscrollbars-vue.d.ts"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "run-p build-js build-types",
|
||||
"test": "vitest --environment jsdom",
|
||||
@@ -8,22 +24,21 @@
|
||||
"build-types": "vue-tsc --emitDeclarationOnly -p tsconfig.types.json --composite false"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": ">=2.0.0"
|
||||
"vue": "^3.2.25"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jsdom": "^16.2.14",
|
||||
"@types/node": "^16.11.45",
|
||||
"@vitejs/plugin-vue2": "^1.1.2",
|
||||
"@vue/test-utils": "^1.3.0",
|
||||
"@vitejs/plugin-vue": "^3.1.2",
|
||||
"@vue/test-utils": "^2.1.0",
|
||||
"@vue/tsconfig": "^0.1.3",
|
||||
"jsdom": "^20.0.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"terser": "^5.14.2",
|
||||
"typescript": "~4.7.4",
|
||||
"vite": "^3.0.2",
|
||||
"vite": "^3.0.0",
|
||||
"vitest": "^0.18.1",
|
||||
"vue": "^2.7.7",
|
||||
"vue-template-compiler": "^2.7.7",
|
||||
"vue-tsc": "^0.38.9"
|
||||
"vue": "^3.2.25",
|
||||
"vue-tsc": "^1.0.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ defineProps<{
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="greetings">
|
||||
<h1 class="green">{{ msg }}</h1>
|
||||
<div>
|
||||
<h1>{{ msg }}</h1>
|
||||
<h3>
|
||||
You’ve successfully created a project with
|
||||
Works!
|
||||
<a target="_blank" href="https://vitejs.dev/">Vite</a> +
|
||||
<a target="_blank" href="https://v2.vuejs.org/">Vue 2</a>.
|
||||
</h3>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export { default as OverlayScrollbarsComponent } from './OverlayScrollbars.vue';
|
||||
@@ -0,0 +1 @@
|
||||
export { default as OverlayScrollbarsComponent } from './overlayscrollbars.vue';
|
||||
@@ -1,10 +0,0 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import HelloWorld from '~/OverlayScrollbars.vue';
|
||||
|
||||
describe('HelloWorld', () => {
|
||||
it('renders properly', () => {
|
||||
const wrapper = mount(HelloWorld, { propsData: { msg: 'Hello Vitest' } });
|
||||
expect(wrapper.text()).toContain('Hello Vitest');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,10 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import OverlayScrollbarsComponent from '~/overlayscrollbars.vue';
|
||||
|
||||
describe('OverlayScrollbarsComponent', () => {
|
||||
it('renders properly', () => {
|
||||
const wrapper = mount(OverlayScrollbarsComponent, { propsData: { msg: 'Hello Vitest' } });
|
||||
expect(wrapper.text()).toContain('Hello Vitest');
|
||||
});
|
||||
});
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"lib": [],
|
||||
"types": ["node", "jsdom"]
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,19 @@
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath, URL } from 'node:url';
|
||||
import { defineConfig } from 'vite';
|
||||
import vue2 from '@vitejs/plugin-vue2';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
lib: {
|
||||
entry: path.resolve(__dirname, 'src/index.ts'),
|
||||
entry: path.resolve(__dirname, 'src/overlayscrollbars-vue.ts'),
|
||||
name: 'OverlayScrollbarsVue',
|
||||
fileName: (format) => `overlayscrollbars-vue.${format}.js`,
|
||||
},
|
||||
rollupOptions: {
|
||||
external: ['vue'],
|
||||
output: {
|
||||
sourcemap: true,
|
||||
dir: 'dist',
|
||||
globals: {
|
||||
vue: 'Vue',
|
||||
@@ -25,5 +26,5 @@ export default defineConfig({
|
||||
'~': fileURLToPath(new URL('./src', import.meta.url)),
|
||||
},
|
||||
},
|
||||
plugins: [vue2()],
|
||||
plugins: [vue()],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user