• vue-waterfall2 实现瀑布流,及总结的问题


    注意:引入需要在主界面引入,直接在组件中引用会有问题

    1.安装 npm install vue-waterfall2@1.8.20 --save    (提示:一定要安装1.8.20,最新版会有一部分问题)

    2.打开main.js文件

    import waterfall from 'vue-waterfall2'

    Vue.use(waterfall)

    3.components新建 load.vue  (复制粘贴

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    17

    18

    19

    20

    21

    22

    23

    24

    25

    26

    27

    28

    29

    30

    31

    32

    33

    34

    35

    36

    37

    38

    39

    40

    41

    42

    43

    44

    45

    46

    47

    48

    49

    50

    51

    52

    53

    54

    55

    56

    57

    58

    59

    60

    61

    62

    63

    64

    65

    66

    67

    68

    69

    70

    71

    72

    73

    74

    75

    76

    77

    78

    79

    80

    81

    82

    83

    84

    85

    86

    87

    88

    89

    90

    91

    92

    93

    94

    95

    96

    97

    98

    99

    100

    101

    102

    103

    104

    105

    106

    107

    108

    109

    110

    111

    112

    113

    114

    115

    116

      

    3.新建一个.vue的文件(复制粘贴)

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    17

    18

    19

    20

    21

    22

    23

    24

    25

    26

    27

    28

    29

    30

    31

    32

    33

    34

    35

    36

    37

    38

    39

    40

    41

    42

    43

    44

    45

    46

    47

    48

    49

    50

    51

    52

    53

    54

    55

    56

    57

    58

    59

    60

    61

    62

    63

    64

    65

    66

    67

    68

    69

    70

    71

    72

    73

    74

    75

    76

    77

    78

    79

    80

    81

    82

    83

    84

    85

    86

    87

    88

    89

    90

    91

    92

    93

    94

    95

    96

    97

    98

    99

    100

    101

    102

    103

    104

    105

    106

    107

    108

    109

    110

    111

    112

    113

    114

    115

    116

    117

    118

    119

    120

    121

    122

    123

    124

    125

    126

    127

    128

    129

    130

    131

    132

    133

    134

    135

    136

    137

    138

    139

    140

    141

    142

    143

    144

    145

    146

    147

    148

    149

    150

    151

    152

    153

    154

    155

    156

    157

    158

    159

    160

    161

    162

    163

    164

    165

    166

    167

    168

    169

    170

    171

    172

    173

    174

    175

    176

    177

    178

    179

    180

    181

    182

    183

    184

    185

    186

    187

    188

    189

    190

    191

    192

    193

    194

    195

    196

    197

    198

    199

    200

    201

    202

    203

    204

    205

    206

    207

    208

    209

    210

    211

    212

    213

    214

    215

    216

    217

    218

    219

    220

    221

    222

    223

    224

    225

    226

    227

    228

    229

    230

    231

    232

    233

    234

    235

    236

    237

    238

    239

    240

    241

    242

    243

    244

    245

    246

    247

    248

    249

    250

    251

    252

    253

    254

    255

    256

    257

    258

    259

    260

    261

    262

    263

    264

    265

    266

    267

    268

    269

    270

    271

    272

    273

    274

    275

    276

    277

    278

    279

    280

    281

    282

    283

    284

    285

    286

    287

    288

    289

    290

    291

    292

    293

    294

    295

    296

    297

    298

    299

    300

    301

    302

    303

    304

    305

    306

    307

    308

    309

    310

    311

    312

    313

    314

    315

    316

    317

    318

    319

    320

    321

    322

    323

    324

    325

    326

    327

    328

    329

    330

    331

    332

    333

    334

    335

    336

    337

    338

    339

    340

    341

    342

    343

    344

    345

    346

    347

    348

    349

    350

    351

    352

    353

    354

    355

    356

    357

    358

    359

    360

    361

    362

    363

    364

    365

    366

    367

    368

    369

    370

    371

    372

    373

    374

    375

    376

    377

    378

    379

    380

    381

    382

    383

    384

    385

    386

    387

    388

    389

    390

    391

    392

    393

    394

    395

    396

    397

    398

    399

    400

    401

    402

    403

    404

    405

    406

    407

    408

    409

    410

    411

    412

    413

    414

    415

    416

    417

    418

    419

    420

    421

    422

    423

    424

    425

    426

    427

    428

    429

    430

    431

    432

    433

    434

    435

    436

    437

    438

    439

    440

    441

    442

    443

    444

    445

    446

    447

    448

    449

    450

    451

    452

    453

    454

    455

    456

    457

    458

    459

    460

    461

    462

    463

    464

    465

    466

    467

    468

    469

    470

    471

    "scss" scoped>

    .container-water-fall {

      // padding: 0 28px;

      box-sizing: border-box;

      &.water-content {

        margin: 0 15px;

      }

      h4 {

        padding-top: 56px;

        padding-bottom: 28px;

        font-family: PingFangSC-Medium;

        font-size: 36px;

        color: #000000;

        letter-spacing: 1px;

        text-align: justify;

      }

      button {

        background-color: #ff0;

        color: #24292e;

        border: 1px solid rgba(27, 31, 35, 0.2);

        border-radius: 0.25em;

        width: 100px;

        line-height: 26px;

        font-size: 13px;

        margin: 4px 0;

        margin-right: 4px;

        cursor: pointer;

        outline: none;

        &.blue-light {

          background: #27fbc2;

        }

      }

      button:hover {

        background-image: linear-gradient(-180deg, #fafbfc, #ccc 90%);

      }

      .cell-item {

        width: 100%;

        background: #ffffff;

        overflow: hidden;

        box-sizing: border-box;

        border-radius: 6px;

        margin-top: 10px;

        img {

          // border-radius: 12px 12px 0 0;

          width: 100%;

          height: auto;

          display: block;

        }

        .item-body {

          // border: 1px solid #F0F0F0;

          padding: 12px;

          .item-desc {

            font-size: 15px;

            color: #333333;

            line-height: 15px;

            font-weight: bold;

          }

          .item-footer {

            margin-top: 22px;

            position: relative;

            display: flex;

            align-items: center;

            .avatar {

              width: 44px;

              height: 44px;

              border-radius: 50%;

              background-repeat: no-repeat;

              background-size: contain;

            }

            .name {

              max-width: 150px;

              margin-left: 10px;

              font-size: 14px;

              color: #999999;

            }

            .like {

              position: absolute;

              right: 0;

              display: flex;

              align-items: center;

              &.active {

                i {

                }

                .like-total {

                  color: #ff4479;

                }

              }

              i {

                width: 28px;

                display: block;

              }

              .like-total {

                margin-left: 10px;

                font-size: 12px;

                color: #999999;

              }

            }

          }

        }

      }

    }

    .githubdata {

      float: right;

      margin-right: 90px;

      img {

        width: 14px;

        // height: 16px;

      }

    }

    总结问题:

    1. 本人下载vue-waterfall2  @1.9.0版本,插件设定了高度,导致插件内容可以滚动,如果在插件上面加入banner或者其他内容,不会随着屏幕的滚动而滚动,

    2. body ,head {

      height: 100%;

    }

    body,head 高度100%,会导致页面滑动到最后的时候监听不到滚动底部的事件,一定要保证页面css样式不能冲突

  • 相关阅读:
    java计算机毕业设计健康饮食推荐系统MyBatis+系统+LW文档+源码+调试部署
    【java学习】项目: ATM系统
    全网最硬核 JVM TLAB 分析 4. TLAB 基本流程全分析
    Deepwalk详解
    JDBC入门、数据库连接方式
    【ACWing】3429. 全排列
    3个云渲染平台的价格体系,哪个最合适(四)
    【RcoketMQ】RcoketMQ 5.0新特性(二)- Pop消费模式
    从零开始的 MyBatis 拦截器之旅:实战经验分享
    Java InputStream.available方法具有什么功能呢?
  • 原文地址:https://blog.csdn.net/Sensation_cyq/article/details/134529861