feat(widget): 新增评论组件核心功能及开发环境配置
新增评论组件核心功能,包括评论列表、分页、回复、表单验证等功能 添加开发环境配置,包括Vite构建配置、样式变量和工具函数 实现管理员验证功能,支持本地存储加密 添加组件基础类及常用组件如加载状态、分页、模态框等 配置文档站点构建流程,支持widget独立构建和集成
This commit is contained in:
26
docs/widget/src/index.js
Normal file
26
docs/widget/src/index.js
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Momo Comments Widget 入口文件
|
||||
*
|
||||
* 使用方法:
|
||||
* ```html
|
||||
* <div id="comments"></div>
|
||||
* <script src="cwd.js"></script>
|
||||
* <script>
|
||||
* new CWDComments({
|
||||
* el: '#comments',
|
||||
* apiBaseUrl: 'https://api.example.com'
|
||||
* }).mount();
|
||||
* </script>
|
||||
* ```
|
||||
*/
|
||||
|
||||
import { CWDComments } from './core/CWDComments.js';
|
||||
|
||||
// 导出为全局变量(用于 UMD 构建)
|
||||
if (typeof window !== 'undefined') {
|
||||
window.CWDComments = CWDComments;
|
||||
}
|
||||
|
||||
// ES Module 默认导出
|
||||
export default CWDComments;
|
||||
export { CWDComments };
|
||||
Reference in New Issue
Block a user