riot实现日历组件标签的编写

riot实现日历组件标签的编写_第1张图片

app.tag file



    
{ opts.date.date.format(yearFormat) }
{ opts.date.date.format(monthFormat) }
Mo
Tu
We
Th
Fr
Sa
Su
style.css  file

.demo {
    position: relative;
    min-height: 200px;
}
.container {
    position: relative;
    display: inline-block;
    cursor: pointer;
}
app .calendar, [riot-tag="rg-date"] .calendar, [data-is="app"] .calendar {
    position: absolute;
    min-width: 300px;
    margin-top: .5em;
    left: 0;
}
.calendar {
    display:-ms-flexbox;
    display:flex;
    -ms-flex-wrap:wrap;
    flex-wrap:wrap;
    -ms-flex-align:center;
    align-items:center;
    padding-right:0;
    padding-left:0;
    max-width:400px;
    padding:.25em;
    border:1px solid #96a8b2;
    border-radius:4px;
    background-color:#fff;
    text-align:center;
    z-index:2;
}
.calendar__control {
    background-color: #fff;
    color: #96a8b2;
    display: inline;
    -ms-flex: 0 0 14.28%;
    flex: 0 0 14.28%;
    max-width: 14.28%;
    margin: 0;
    padding: 1em .5em;
    border: 1px solid transparent;
    border-radius: 4px;
    outline: 0;
    font-size: 1em;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.calendar--high {
    box-shadow: 0 5px 5px -2px rgba(17,17,17,0.4);
}
.calendar__header {
    padding-right:1em;padding-left:1em;padding-right:0;padding-left:0;padding:.5em 0;
}
.calendar__day {
    background-color: #fff;
    color: #96a8b2;
    display: inline;
    -ms-flex: 0 0 14.28%;
    flex: 0 0 14.28%;
    max-width: 14.28%;
    margin: 0;
    padding: 1em .5em;
    border: 1px solid transparent;
    border-radius: 4px;
    outline: 0;
    font-size: 1em;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.calendar__date {
    background-color: #fff;
    color: #969696;
    padding-top: 1em;
    padding-bottom: 1em;
    padding-left: 0.5em;
    padding-right: 0.5em;
    font-size: 1em;
    -webkit-flex: 0 0 14.28%;
    -ms-flex: 0 0 14.28%;
    flex: 0 0 14.28%;
    max-width: 14.28%;
    margin: 0;
    outline: 0;
    display: inline;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.calendar__date--in-month {
    color: #111;
}
.button--primary {
    background-color: #42A5F5;
    color: #fff;
}
.button--block {
    display: inline-block;
    width: 100%;
}
.button {
    padding-top: 0.5em;
    padding-bottom: 0.5em;
    padding-left: 0.5em;
    padding-right: 0.5em;
    outline: 0;
    display: inline;
    margin: 0;
    max-width: 100%;
    border: 0;
    border-radius: 4px;
    font-size: 1em;
    text-decoration: none;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #969696;
    color: #fff;
}
.field {
    padding-top: 0.5em;
    padding-bottom: 0.5em;
    padding-left: 0.5em;
    padding-right: 0.5em;
    display: block;
    width: 100%;
    margin: 0;
    font-size: 1em;
    font-weight: normal;
    font-family: inherit;
    background-color: #fff;
    border: 1px solid #adadad;
    border-radius: 4px;
    box-shadow: 0 3px 3px -3px #c4c4c4 inset;
    resize: vertical;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

index.html





    Riot Date Example: Date
    
    
    





你可能感兴趣的:(riot,自定义组件)