zoukankan      html  css  js  c++  java
  • angular 基本树结构

    HTML:

    http://www.ngnice.com/showcase/#/tree/basic

    <link rel="stylesheet" href="views/tree/basic.css"/> <div class="tree"> <ul> <li ng-repeat="country in vm.countries" ng-class="{closed:country.closed}"> <div ng-click="country.closed=!country.closed"> <span class="glyphicon" ng-class="country.closed?'glyphicon-plus':'glyphicon-minus'"></span> <img ng-src="images/{{country.flag}}"/> {{country.label}} </div> <ul ng-class="{hidden: country.closed}"> <li ng-repeat="province in country.provinces" ng-class="{closed:province.closed}"> <div ng-click="province.closed=!province.closed"> <span class="glyphicon" ng-class="province.closed?'glyphicon-plus':'glyphicon-minus'"></span> {{province.label}} </div> <ul ng-class="{hidden: province.closed}"> <li ng-repeat="city in province.cities" ng-click="vm.select(country, province, city)"> {{city.label}} </li> </ul> </li> </ul> </li> </ul> </div> <div ng-if="vm.city">国家:<img ng-src="images/{{vm.country.flag}}">{{vm.country.label}} 省份:{{vm.province.label}} 城市:{{vm.city.label}} </div>

    CSS:

    .tree li { cursor: pointer; padding-left: 1.3em; } .tree ul { list-style: none; padding-left: 0; }

    JS:

    'use strict'; angular.module('ngShowcaseApp').controller('ctrl.tree.basic', function ($scope, CityData) { var vm = $scope.vm = {}; vm.countries = CityData; vm.select = function(country, province, city) { vm.country = country; vm.province = province; vm.city = city; }; });

     

     

  • 相关阅读:
    bx值
    玲珑杯1147
    Castle
    美团 CodeM 复赛」城市网络
    上海五校赛 密码破解
    上海五校赛 零件组装
    opencv色彩空间
    opencv对图片每个像素操作
    opencv图像的读取和保存以及调用摄像头。
    numpy的logspace产生等比数列
  • 原文地址:https://www.cnblogs.com/bmaker/p/5751515.html
Copyright © 2011-2022 走看看