【Vue3+Vite+TS】13.0 组件十:强大的表单组件(上)

功能

    1. 可配置型表单,通过json对象的方式自动生成表单
    1. 具备更完善的功能:表单验证、自定义验证规则、动态删减表单、集成第三方的插件
    1. 用法简单,扩展性强,可维护性强
    1. 能够用在更多的场景,比如弹框嵌套表单

准备工作

  1. 分析element-plus表单能够在那些方面做优化
  2. 完善封装表单的类型,支持ts
  3. 封装的表单要具备element-plus原表单的所有功能
  4. 集成第三方插件:markdown编辑器、富文本编辑器(
    比如WangEditor)

必备UI组件

将用到的组件:
很多,涉及到表单的所有组件。
第三方组件:WangEditor

组件设计

新建src\components\baseline\form\index.ts

import { App } from 'vue'
import Form from './src/index.vue'

export { Form }

//组件可通过use的形式使用
export default {
  Form,
    install(app: App) {
        app.component('bs-form', Form)
    },
}

调整src\components\baseline\index.ts

import { App } from 'vue'
import ChooseArea from './chooseArea'
import ChooseIcon from './chooseIcon'
import Container from './container'
import Trend from './trend'
import Notification from './notification'
import List from './list'
import Menu from './menu'
import Progress from './progress'
import ChooseTime from './chooseTime'
import ChooseDate from './chooseDate'
import ChooseCity from './chooseCity'
import Form from './form'
const components = [
    ChooseArea,
    ChooseIcon,
    Container,
    Trend,
    Notification,
    List,
    Menu,
    Progress,
    ChooseTime,
    ChooseDate,
    ChooseCity,
    Form,
]
export {
    ChooseArea,
    ChooseIcon,
    Container,
    Trend,
    Notification,
    List,
    Menu,
    Progress,
    ChooseTime,
    ChooseDate,
    ChooseCity,
    Form,
}

//组件可通过use的形式使用
export default {
    install(app: App) {
        components.map(item => {
            app.use(item)
        })
    },
    ChooseArea,
    ChooseIcon,
    Container,
    Trend,
    Notification,
    List,
    Menu,
    Progress,
    ChooseTime,
    ChooseDate,
    ChooseCity,
    Form,
}

路由增加,调整src\router\index.ts

   {
                path: '/form',
                component: () => import('../views/baseline/form/index.vue'),
            },

新增src\views\baseline\form\index.vue

<template>
    <div class="bs-wrapper">
        <bs-form :options="options"></bs-form>
    </div>
</template>
<script lang="ts" setup>
import { FormOptions } from '@/components/baseline/form/src/types/types'

let options: FormOptions[] = [
    {
        type: 'input',
        value: '',
        label: '用户名',
        rules: [
            {
                required: true,
                message: '用户名不能为空',
                trigger: 'blur',
            },
            {
                min: 2,
                max: 10,
                message: '用户名长度在2-10位之间',
                trigger: 'blur',
            },
        ],
        attrs: {
            showPassword: true,
        },
    },
]
</script>
<style lang="scss" scoped></style>

到此,基本结构搭建完毕。

如果需要做到表单通过json自动配置组合,需要建立一套完整的ts类型限制。
新建src\components\baseline\form\src\types\types.ts

import { CSSProperties } from 'vue'
import { RuleItem } from './rule'

import { ValidateFieldsError } from 'async-validator'
interface Callback {
    (isValid?: boolean, invalidFields?: ValidateFieldsError): void
}

/**
 * 表单每一项的配置选项
 */
export interface FormOptions {
    // 表单项显示的元素
    type:
        | 'cascader'//级联选择器
        | 'checkbox'//多选框
        | 'checkbox-group'
        | 'checkbox-button'
        | 'color-picker'
        | 'date-picker'
        | 'input'
        | 'input-number'
        | 'radio'
        | 'radio-group'
        | 'radio-button'
        | 'rate'
        | 'select'
        | 'option'
        | 'slider'
        | 'switch'
        | 'time-picker'
        | 'time-select'
        | 'transfer'//穿梭框
        | 'upload'
        | 'editor'
    // 表单项的值
    value?: any
    // 表单项label
    label?: string
    // 表单项的标识
    prop?: string
    // 表单项的验证规则
    rules?: RuleItem[]//基于async-validator规则验证
    // 表单项的占位符
    placeholder?: string
    // 表单元素特有的属性
    attrs?: {
        // css样式
        style?: CSSProperties
        clearable?: boolean
        showPassword?: boolean
        disabled?: boolean
    }
    // 表单项的子元素
    children?: FormOptions[]
    // 处理上传组件的属性和方法
    uploadAttrs?: {
        action: string
        headers?: object
        method?: 'post' | 'put' | 'patch'
        multiple?: boolean
        data?: any
        name?: string
        withCredentials?: boolean
        showFileList?: boolean
        drag?: boolean
        accept?: string
        thumbnailMode?: boolean
        fileList?: any[]
        listType?: 'text' | 'picture' | 'picture-card'
        autoUpload?: boolean
        disabled?: boolean
        limit?: number
    }
}

export interface ValidateFieldCallback {
    (message?: string, invalidFields?: ValidateFieldsError): void
}

export interface FormInstance {
    registerLabelWidth(width: number, oldWidth: number): void
    deregisterLabelWidth(width: number): void
    autoLabelWidth: string | undefined
    emit: (evt: string, ...args: any[]) => void
    labelSuffix: string
    inline?: boolean
    model?: Record<string, unknown>
    size?: string
    showMessage?: boolean
    labelPosition?: string
    labelWidth?: string
    rules?: Record<string, unknown>
    statusIcon?: boolean
    hideRequiredAsterisk?: boolean
    disabled?: boolean
    validate: (callback?: Callback) => Promise<boolean>
    resetFields: () => void
    clearValidate: (props?: string | string[]) => void
    validateField: (props: string | string[], cb: ValidateFieldCallback) => void
}

新建src\components\baseline\form\src\types\rule.ts
该文件从async-validator规则验证github项目中复制出来的,不需要自己思考文件内容。

export type RuleType =
  | 'string'
  | 'number'
  | 'boolean'
  | 'method'
  | 'regexp'
  | 'integer'
  | 'float'
  | 'array'
  | 'object'
  | 'enum'
  | 'date'
  | 'url'
  | 'hex'
  | 'email'
  | 'pattern'
  | 'any';

export interface ValidateOption {
  // whether to suppress internal warning
  suppressWarning?: boolean;

  // when the first validation rule generates an error stop processed
  first?: boolean;

  // when the first validation rule of the specified field generates an error stop the field processed, 'true' means all fields.
  firstFields?: boolean | string[];

  messages?: Partial<ValidateMessages>;

  /** The name of rules need to be trigger. Will validate all rules if leave empty */
  keys?: string[];

  error?: (rule: InternalRuleItem, message: string) => ValidateError;
}

export type SyncErrorType = Error | string;
export type SyncValidateResult = boolean | SyncErrorType | SyncErrorType[];
export type ValidateResult = void | Promise<void> | SyncValidateResult;

export interface RuleItem {
  type?: RuleType; // default type is 'string'
  required?: boolean;
  pattern?: RegExp | string;
  min?: number; // Range of type 'string' and 'array'
  max?: number; // Range of type 'string' and 'array'
  len?: number; // Length of type 'string' and 'array'
  enum?: Array<string | number | boolean | null | undefined>; // possible values of type 'enum'
  whitespace?: boolean;
  trigger?: string | string[];
  fields?: Record<string, Rule>; // ignore when without required
  options?: ValidateOption;
  defaultField?: Rule; // 'object' or 'array' containing validation rules
  transform?: (value: Value) => Value;
  message?: string | ((a?: string) => string);
  asyncValidator?: (
    rule: InternalRuleItem,
    value: Value,
    callback: (error?: string | Error) => void,
    source: Values,
    options: ValidateOption,
  ) => void | Promise<void>;
  validator?: (
    rule: InternalRuleItem,
    value: Value,
    callback: (error?: string | Error) => void,
    source: Values,
    options: ValidateOption,
  ) => SyncValidateResult | void;
}

export type Rule = RuleItem | RuleItem[];

export type Rules = Record<string, Rule>;

/**
 *  Rule for validating a value exists in an enumerable list.
 *
 *  @param rule The validation rule.
 *  @param value The value of the field on the source object.
 *  @param source The source object being validated.
 *  @param errors An array of errors that this rule may add
 *  validation errors to.
 *  @param options The validation options.
 *  @param options.messages The validation messages.
 *  @param type Rule type
 */
export type ExecuteRule = (
  rule: InternalRuleItem,
  value: Value,
  source: Values,
  errors: string[],
  options: ValidateOption,
  type?: string,
) => void;

/**
 *  Performs validation for any type.
 *
 *  @param rule The validation rule.
 *  @param value The value of the field on the source object.
 *  @param callback The callback function.
 *  @param source The source object being validated.
 *  @param options The validation options.
 *  @param options.messages The validation messages.
 */
export type ExecuteValidator = (
  rule: InternalRuleItem,
  value: Value,
  callback: (error?: string[]) => void,
  source: Values,
  options: ValidateOption,
) => void;

// >>>>> Message
type ValidateMessage<T extends any[] = unknown[]> =
  | string
  | ((...args: T) => string);
type FullField = string | undefined;
type EnumString = string | undefined;
type Pattern = string | RegExp | undefined;
type Range = number | undefined;
type Type = string | undefined;

export interface ValidateMessages {
  default?: ValidateMessage;
  required?: ValidateMessage<[FullField]>;
  enum?: ValidateMessage<[FullField, EnumString]>;
  whitespace?: ValidateMessage<[FullField]>;
  date?: {
    format?: ValidateMessage;
    parse?: ValidateMessage;
    invalid?: ValidateMessage;
  };
  types?: {
    string?: ValidateMessage<[FullField, Type]>;
    method?: ValidateMessage<[FullField, Type]>;
    array?: ValidateMessage<[FullField, Type]>;
    object?: ValidateMessage<[FullField, Type]>;
    number?: ValidateMessage<[FullField, Type]>;
    date?: ValidateMessage<[FullField, Type]>;
    boolean?: ValidateMessage<[FullField, Type]>;
    integer?: ValidateMessage<[FullField, Type]>;
    float?: ValidateMessage<[FullField, Type]>;
    regexp?: ValidateMessage<[FullField, Type]>;
    email?: ValidateMessage<[FullField, Type]>;
    url?: ValidateMessage<[FullField, Type]>;
    hex?: ValidateMessage<[FullField, Type]>;
  };
  string?: {
    len?: ValidateMessage<[FullField, Range]>;
    min?: ValidateMessage<[FullField, Range]>;
    max?: ValidateMessage<[FullField, Range]>;
    range?: ValidateMessage<[FullField, Range, Range]>;
  };
  number?: {
    len?: ValidateMessage<[FullField, Range]>;
    min?: ValidateMessage<[FullField, Range]>;
    max?: ValidateMessage<[FullField, Range]>;
    range?: ValidateMessage<[FullField, Range, Range]>;
  };
  array?: {
    len?: ValidateMessage<[FullField, Range]>;
    min?: ValidateMessage<[FullField, Range]>;
    max?: ValidateMessage<[FullField, Range]>;
    range?: ValidateMessage<[FullField, Range, Range]>;
  };
  pattern?: {
    mismatch?: ValidateMessage<[FullField, Value, Pattern]>;
  };
}

export interface InternalValidateMessages extends ValidateMessages {
  clone: () => InternalValidateMessages;
}

// >>>>> Values
export type Value = any;
export type Values = Record<string, Value>;

// >>>>> Validate
export interface ValidateError {
  message?: string;
  fieldValue?: Value;
  field?: string;
}

export type ValidateFieldsError = Record<string, ValidateError[]>;

export type ValidateCallback = (
  errors: ValidateError[] | null,
  fields: ValidateFieldsError | Values,
) => void;

export interface RuleValuePackage {
  rule: InternalRuleItem;
  value: Value;
  source: Values;
  field: string;
}

export interface InternalRuleItem extends Omit<RuleItem, 'validator'> {
  field?: string;
  fullField?: string;
  fullFields?: string[];
  validator?: RuleItem['validator'] | ExecuteValidator;
}

组件完善

新建src\components\baseline\form\src\index.vue

<template>
    <div>
        <el-form>
            <el-form-item v-for="(item, index) in options" :key="index">
                <component :is="`el-${item.type}`"></component>
            </el-form-item>
        </el-form>
    </div>
</template>
<script lang="ts" setup>
import { PropType } from 'vue'
import { FormOptions } from './types/types'
let props = defineProps({
    options: {
        type: Array as PropType<FormOptions[]>,
        required: true,
    },
})
</script>
<style lang="scss" scoped></style>

运行效果如下:


image.png

优化:

            <el-form-item
                :label="item.label"
                v-for="(item, index) in options"
                :key="index"
            >
                <component :is="`el-${item.type}`"></component>
            </el-form-item>

效果如下:


image.png

表单本身属性扩展:

        <el-form v-bind="$attrs">
            <el-form-item
                :label="item.label"
                v-for="(item, index) in options"
                :key="index"
            >
                <component :is="`el-${item.type}`"></component>
            </el-form-item>
        </el-form>

修改src\views\baseline\form\index.vue

<template>
    <div class="bs-wrapper">
        <bs-form label-width="1rem" :options="options"></bs-form>
    </div>
</template>
<script lang="ts" setup>
import { FormOptions } from '@/components/baseline/form/src/types/types'

let options: FormOptions[] = [
    {
        type: 'input',
        value: '',
        label: '用户名',
        rules: [
            {
                required: true,
                message: '用户名不能为空',
                trigger: 'blur',
            },
            {
                min: 2,
                max: 10,
                message: '用户名长度在2-10位之间',
                trigger: 'blur',
            },
        ],
        attrs: {
            showPassword: true,
        },
    },
    {
        type: 'input',
        value: '',
        label: '密码',
        rules: [
            {
                required: true,
                message: '密码不能为空',
                trigger: 'blur',
            },
            {
                min: 6,
                max: 20,
                message: '密码长度在6-20位之间',
                trigger: 'blur',
            },
        ],
        attrs: {
            showPassword: true,
        },
    },
]
</script>
<style lang="scss" scoped></style>

效果如下:


image.png

这里需要用到深拷贝,建议使用一个很好地第三方js工具库:

 npm i -S lodash @types/lodash

优化src\components\baseline\form\src\index.vue

<template>
    <div>
        <!-- validate-on-rule-change="false"不需要一进来就验证 -->
        <el-form
            :validate-on-rule-change="false"
            :model="model"
            :rules="rules"
            v-bind="$attrs"
        >
            <el-form-item
                :prop="item.prop"
                :label="item.label"
                v-for="(item, index) in options"
                :key="index"
            >
                <component
                    v-bind="item.attrs"
                    :is="`el-${item.type}`"
                    v-model="model[item.prop!]"
                ></component>
            </el-form-item>
        </el-form>
    </div>
</template>
<script lang="ts" setup>
import { PropType, ref, onMounted } from 'vue'
import { FormOptions } from './types/types'
let props = defineProps({
    options: {
        type: Array as PropType<FormOptions[]>,
        required: true,
    },
})
//局部引入,深拷贝
import cloneDeep from 'lodash/cloneDeep'

const model = ref<any>({})
const rules = ref<any>({})

onMounted(() => {
    let m: any = {}
    let r: any = {}
    props.options.map((item: FormOptions) => {
        m[item.prop!] = item.value
        r[item.prop!] = item.rules
    })
    model.value = cloneDeep(m)
    rules.value = cloneDeep(r)
    console.log('model', model.value)
    console.log('rules', rules.value)
})
</script>
<style lang="scss" scoped></style>

调整src\views\baseline\form\index.vue

<template>
    <div class="bs-wrapper">
        <bs-form label-width="1rem" :options="options"></bs-form>
    </div>
</template>
<script lang="ts" setup>
import { FormOptions } from '@/components/baseline/form/src/types/types'

let options: FormOptions[] = [
    {
        type: 'input',
        value: '',
        label: '用户名',
        prop: 'username',
        rules: [
            {
                required: true,
                message: '用户名不能为空',
                trigger: 'blur',
            },
            {
                min: 2,
                max: 10,
                message: '用户名长度在2-10位之间',
                trigger: 'blur',
            },
        ],
        attrs: {
            clearable: true,
        },
    },
    {
        type: 'input',
        value: '',
        label: '密码',
        prop: 'password',
        rules: [
            {
                required: true,
                message: '密码不能为空',
                trigger: 'blur',
            },
            {
                min: 6,
                max: 20,
                message: '密码长度在6-20位之间',
                trigger: 'blur',
            },
        ],
        attrs: {
            showPassword: true,
            clearable: true,
        },
    },
]
</script>
<style lang="scss" scoped></style>

效果基本完成:


image.png

子元素组件

像select,是存在option子元素的,调整如下:
修改src\views\baseline\form\index.vue

<template>
    <div class="bs-wrapper">
        <bs-form label-width="1rem" :options="options"></bs-form>
    </div>
</template>
<script lang="ts" setup>
import { FormOptions } from '@/components/baseline/form/src/types/types'

let options: FormOptions[] = [
    {
        type: 'input',
        value: '',
        label: '用户名',
        prop: 'username',
        placeholder: '请输入用户名',
        rules: [
            {
                required: true,
                message: '用户名不能为空',
                trigger: 'blur',
            },
            {
                min: 2,
                max: 10,
                message: '用户名长度在2-10位之间',
                trigger: 'blur',
            },
        ],
        attrs: {
            clearable: true,
        },
    },
    {
        type: 'input',
        value: '',
        label: '密码',
        prop: 'password',
        placeholder: '请输入6-20位密码',
        rules: [
            {
                required: true,
                message: '密码不能为空',
                trigger: 'blur',
            },
            {
                min: 6,
                max: 20,
                message: '密码长度在6-20位之间',
                trigger: 'blur',
            },
        ],
        attrs: {
            showPassword: true,
            clearable: true,
        },
    },
    {
        type: 'select',
        value: '1',//初始化表单数据
        label: '职位',
        prop: 'role',
        placeholder: '请选择职位',
        rules: [
            {
                required: true,
                message: '职位不能为空',
                trigger: 'blur',
            },
        ],
        children: [
            { type: 'option', label: '经理', value: '1' },
            { type: 'option', label: '主管', value: '2' },
            { type: 'option', label: '员工', value: '3' },
        ],
    },
]
</script>
<style lang="scss" scoped></style>

修改src\components\baseline\form\src\index.vue

<template>
    <div class="bs-wrapper">
        <bs-form label-width="1rem" :options="options"></bs-form>
    </div>
</template>
<script lang="ts" setup>
import { FormOptions } from '@/components/baseline/form/src/types/types'

let options: FormOptions[] = [
    {
        type: 'input',
        value: '',
        label: '用户名',
        prop: 'username',
        placeholder: '请输入用户名',
        rules: [
            {
                required: true,
                message: '用户名不能为空',
                trigger: 'blur',
            },
            {
                min: 2,
                max: 10,
                message: '用户名长度在2-10位之间',
                trigger: 'blur',
            },
        ],
        attrs: {
            clearable: true,
        },
    },
    {
        type: 'input',
        value: '',
        label: '密码',
        prop: 'password',
        placeholder: '请输入6-20位密码',
        rules: [
            {
                required: true,
                message: '密码不能为空',
                trigger: 'blur',
            },
            {
                min: 6,
                max: 20,
                message: '密码长度在6-20位之间',
                trigger: 'blur',
            },
        ],
        attrs: {
            showPassword: true,
            clearable: true,
        },
    },
    {
        type: 'select',
        value: '1',//初始化表单数据
        label: '职位',
        prop: 'role',
        placeholder: '请选择职位',
        rules: [
            {
                required: true,
                message: '职位不能为空',
                trigger: 'blur',
            },
        ],
        children: [
            { type: 'option', label: '经理', value: '1' },
            { type: 'option', label: '主管', value: '2' },
            { type: 'option', label: '员工', value: '3' },
        ],
    },
]
</script>
<style lang="scss" scoped></style>

效果如下:


image.png

style样式增加

修改src\views\baseline\form\index.vue

<template>
    <div class="bs-wrapper">
        <bs-form label-width="1rem" :options="options"></bs-form>
    </div>
</template>
<script lang="ts" setup>
import { FormOptions } from '@/components/baseline/form/src/types/types'

let options: FormOptions[] = [
    {
        type: 'input',
        value: '',
        label: '用户名',
        prop: 'username',
        placeholder: '请输入用户名',
        rules: [
            {
                required: true,
                message: '用户名不能为空',
                trigger: 'blur',
            },
            {
                min: 2,
                max: 10,
                message: '用户名长度在2-10位之间',
                trigger: 'blur',
            },
        ],
        attrs: {
            clearable: true,
        },
    },
    {
        type: 'input',
        value: '',
        label: '密码',
        prop: 'password',
        placeholder: '请输入6-20位密码',
        rules: [
            {
                required: true,
                message: '密码不能为空',
                trigger: 'blur',
            },
            {
                min: 6,
                max: 20,
                message: '密码长度在6-20位之间',
                trigger: 'blur',
            },
        ],
        attrs: {
            showPassword: true,
            clearable: true,
        },
    },
    {
        type: 'select',
        value: '1', //初始化表单数据
        label: '职位',
        prop: 'role',
        placeholder: '请选择职位',
        rules: [
            {
                required: true,
                message: '职位不能为空',
                trigger: 'blur',
            },
        ],
        children: [
            { type: 'option', label: '经理', value: '1' },
            { type: 'option', label: '主管', value: '2' },
            { type: 'option', label: '员工', value: '3' },
        ],
        attrs: {
            style: {
                width: '100%',
            },
        },
    },
    {
        type: 'checkbox-group',
        value: [],
        prop: 'like',
        label: '爱好',
        rules: [
            {
                required: true,
                message: '爱好不能为空',
                trigger: 'blur',
            },
        ],
        children: [
            {
                type: 'checkbox',
                label: '足球',
                value: '1',
            },
            {
                type: 'checkbox',
                label: '篮球',
                value: '1',
            },
            {
                type: 'checkbox',
                label: '乒乓球',
                value: '3',
            },
        ],
    },
    {
        type: 'radio-group',
        value: '',
        prop: 'gender',
        label: '性别',
        rules: [
            {
                required: true,
                message: '性别不能为空',
                trigger: 'blur',
            },
        ],
        children: [
            {
                type: 'radio',
                label: '男',
                value: '1',
            },
            {
                type: 'radio',
                label: '女',
                value: '2',
            },
            {
                type: 'radio',
                label: '保密',
                value: '3',
            },
        ],
    },
]
</script>
<style lang="scss" scoped></style>

修改src\components\baseline\form\src\index.vue

<template>
    <div>
        <!-- validate-on-rule-change="false"不需要一进来就验证 -->
        <el-form
            ref="form"
            v-if="model"
            :validate-on-rule-change="false"
            :model="model"
            :rules="rules"
            v-bind="$attrs"
        >
            <template v-for="(item, index) in options" :key="index">
                <el-form-item
                    :prop="item.prop"
                    :label="item.label"
                    v-if="!item.children || !item.children!.length"
                >
                    <component
                        :placeholder="item.placeholder"
                        v-bind="item.attrs"
                        :is="`el-${item.type}`"
                        v-model="model[item.prop!]"
                    ></component>
                </el-form-item>
                <el-form-item
                    :prop="item.prop"
                    :label="item.label"
                    v-if="item.children && item.children.length"
                >
                    <component
                        v-bind="item.attrs"
                        :placeholder="item.placeholder"
                        :is="`el-${item.type}`"
                        v-model="model[item.prop!]"
                    >
                        <component
                            v-for="(child, i) in item.children"
                            :key="i"
                            :label="child.label"
                            :value="child.value"
                            :is="`el-${child.type}`"
                        ></component>
                    </component>
                </el-form-item>
            </template>
        </el-form>
    </div>
</template>
<script lang="ts" setup>
import { PropType, ref, onMounted, watch } from 'vue'
import { FormOptions } from './types/types'
let props = defineProps({
    options: {
        type: Array as PropType<FormOptions[]>,
        required: true,
    },
})
//局部引入,深拷贝
import cloneDeep from 'lodash/cloneDeep'

const model = ref<any>()
const rules = ref<any>()

const initForm = () => {
    let m: any = {}
    let r: any = {}
    props.options.map((item: FormOptions) => {
        m[item.prop!] = item.value
        r[item.prop!] = item.rules
    })
    model.value = cloneDeep(m)
    rules.value = cloneDeep(r)
    console.log('model', model.value)
    console.log('rules', rules.value)
}

onMounted(() => {
    if (props.options && props.options.length) {
        initForm()
    }
})
//监听父组件传递进来的options的变化
watch(
    () => props.options,
    val => {
        initForm()
    },
    { deep: true }
)
</script>
<style lang="scss" scoped></style>

效果如下:


image.png
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 203,547评论 6 477
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 85,399评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 150,428评论 0 337
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,599评论 1 274
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,612评论 5 365
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,577评论 1 281
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 37,941评论 3 395
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,603评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 40,852评论 1 297
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,605评论 2 321
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,693评论 1 329
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,375评论 4 318
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 38,955评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 29,936评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,172评论 1 259
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 43,970评论 2 349
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,414评论 2 342

推荐阅读更多精彩内容