0.0.1-alpha.21 • Published 9 months ago

daisyui-vue v0.0.1-alpha.21

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
9 months ago

daisyui-vue

基于 daisyui 封装的 vue 组件库。

Usage

全局注册:

// main.ts
import daisyui from 'daisyui-vue';
import { createApp, defineComponent } from 'vue';

app.use(daisyui); // 注册

// App.tsx
const App = defineComponent({
  // ...
  setup: () => {
    return () => {
      return (
        <div>
          <dv-button>click</dv-button>
        </div>
      );
    };
  },
});

按需使用:

// main.ts
import { installTheme } from 'daisyui-vue';

const app = createApp({
  // ...
});

app.use(installTheme); // 注册组件库 context,当需要提取首屏样式时使用,否则可以不注册

// App.tsx
import { Button } from 'daisyui-vue';

const App = defineComponent({
  // ...
  setup: () => {
    return () => {
      return (
        <div>
          <Button>click</Button>
        </div>
      );
    };
  },
});

SSR 提取首屏样式,避免 FOUC 问题:

// entry-server.ts

export function render() {
  const app = createApp({
    // ...
  });

  const style = app.config.globalProperties.$daisyui.style.extractStyles(); // <style>...</style>

  const html = renderToString(app);

  return html.replace('<!-- YOUR_STYLE_PLACEHOLDER -->', style);
}

Todo

  • style files
    • auto require style conntent when using a component (now css-in-js)
      • it is easy to use in SSR, but there is no style on first render (FOUC, because css inserted by js). Use extractStyles to extract critical css.
  • media query & responsive
  • refine style insertion detect(maybe use a content hash self-increasing id)
  • pre insert all global style
  • popper/modal/drawer animation(maybe some preset animations)
    • modal, drawer

Components

  • alert
  • artboard
  • avatar
  • badge
  • breadcrumb
  • button
  • button-group
  • card
  • carousel
  • collapse
  • counter 🆕 new
  • divider
  • drawer - 🛠 refactor
  • dropdown - 🛠 refactor(popper inside)
  • footer
  • hero
  • icon - xicons
    • context
  • indicator
  • kbd
  • link
  • mask
  • menu
  • modal
  • navbar
  • pagination
  • progress
  • popper - 🆕 new
  • swap - 🛠 refactor
  • stack
  • stat
  • steps
  • tab
  • table
  • toggle
  • tooltip - 🛠 refactor
  • form-checkbox
  • form-input
  • form-radio
  • form-range
  • form-select
  • form-textarea
  • form-toggle
  • mockup-code
  • mockup-phone
  • mockup-window

命名规则

  • 事件名称,onNameAction:onMaskClick、onEscKeyDown
  • 事件控制,xxxYyable: keyboardCloseable
  • 响应式:mobile first
0.0.1-alpha.21

9 months ago

0.0.1-alpha.16

12 months ago

0.0.1-alpha.18

12 months ago

0.0.1-alpha.17

12 months ago

0.0.1-alpha.20

12 months ago

0.0.1-alpha.19

12 months ago

0.0.1-alpha.15

1 year ago

0.0.1-alpha.14

1 year ago

0.0.1-alpha.12

1 year ago

0.0.1-alpha.11

1 year ago

0.0.1-alpha.13

1 year ago

0.0.1-alpha.10

2 years ago

0.0.1-alpha.8

2 years ago

0.0.1-alpha.9

2 years ago

0.0.1-alpha.6

2 years ago

0.0.1-alpha.7

2 years ago

0.0.1-alpha.5

2 years ago

0.0.1-alpha.4

2 years ago

0.0.1-alpha.3

2 years ago

0.0.1-alpha.2

2 years ago

0.0.1-alpha.1

2 years ago

0.0.1-alpha.0

3 years ago